IBM BPM, V8.0.1, All platforms > Tuning > Advanced tuning > Advanced Java heap tuning
![]()
Setting the heap size when running multiple JVMs on one system
Each running Java™ program has a heap associated with it. Therefore, if you have a configuration where more than one Java program is running on a single physical system, it is important to set the heap sizes appropriately.
If the sum of all of the virtual memory usage (including both Java heaps and all other virtual memory allocations) exceeds the size of physical memory, the Java heaps are subject to paging. This causes total system performance to degrade significantly. To minimize the possibility of this occurring, use the following guidelines:
- Collect a verbosegc trace for each running JVM.
- Based on the verbosegc trace output, set the initial heap size to a relatively low value.
For example, if the verbosegc trace output shows that the heap size grows quickly to 256 MB, and then grows more slowly to 400 MB, set the initial heap size to 256 MB (-ms256m).
- Based on the verbosegc trace output, set the maximum heap size appropriately. Do not set this value too low because Out Of Memory errors might occur. The maximum heap size must be large enough to allow for peak throughput. Using the preceding example, a maximum heap size of 768 MB might be appropriate (-mx768m).
- Do not set the heap sizes too low because this causes garbage collections to occur frequently, which might reduce throughput. A verbosegc trace assists in determining this. A balance must be struck so that the heap sizes are large enough that garbage collections do not occur too often, while still ensuring that the heap sizes are not cumulatively so large as to cause the heap to page. This balancing act is configuration dependent. If you have servers configured to run in 64-bit mode, you can specify an initial maximum heap size of 2048 MB.
Related concepts:
Monitoring garbage collection