This article refers to using Zing with the ZST component. Since ZVM 19.07 the ZST component is optional and depending on your use case Zing without ZST might be the preferred choice now as by its different memory management it is not affected by the problem described here. For large heapsizes (-Xmx setting) of hundreds of GBytes the ZST component adds performance advantages for most applications.
If you get this error when trying to launch an application it means that Zing was unable to reserve enough memory to launch the application.
When you launch an application on Zing it reserves some of your system's RAM for its own use. At a minimum Zing will reserve a chunk of memory equal to your heap size (Xmx). If no other Zing apps are already running it will reserve an additional chunk of memory, usually about 7% of system RAM, for the Zing Contingency Memory and Pause Prevention pools.
If Zing can't reserve all of the memory that it needs it will throw this error: Memory management: unable to fund java heap account and your application won't start.
You can check system memory usage with the 'free' and 'zing-ps -s' command. The zing-ps command also shows the absolute maximum upper limit available for -Xmx values. Those are usually defined as 75% or 85% of the system RAM in /etc/zing/pmem.conf depending on the Zing version.
This failure to start can also happen if there are not enough free 2MB pages and 4MB pages for Zing available due to memory fragmentation. To check that, please run "grep Normal /proc/buddyinfo" and look at the last two columns to see if there are sufficient 2 and 4 MBytes pages.
Example of one machine with zero 2M and 4M pages available:
$ grep Normal /proc/buddyinfo
Node 0, zone Normal 168 69 184 186 182 109 71 386 492 0 0
If no large other processes are occupying memory, then the cause of memory fragmentation might be a high usage activity of the Linux page cache (file system cache). In that situation you can tell the operating system to write back the cache to disk to free memory. Please take care when using the following on a production system if an application is already running in parallel on it as writing all file system cache content back to disk can take seconds to a few minutes on machines with hundreds of GBytes of RAM and temporarily increases I/O load significantly!
To flush the page cache (file system cache):
echo 1 | sudo tee /proc/sys/vm/drop_caches
Since Zing ZST 5.21.7 this situation is resolved much better with Zing automatically. Please consider upgrading the Zing ZST component if you experience this problem often. Zing ZST is available for download on https://www.azul.com/software-downloads-and-documents/. In addition since ZST 5.21.7, an enhanced memory defragmentation can be enabled in Zing: https://docs.azul.com/zing/index.htm#ZingAppA_EnhancedLinuxMemoryDefragmentation.htm
If the recommendations above don't work for you, reboot the system or contact our support: https://www.azul.com/support/