Is setting xmx == xms
is still good practice in java-11 with G1 gc?
I ask this in the context of web applications.
Larger heap size will cause less frequent, but bigger and more disruptive garbage collection if using the traditional oracle garbage collection algorithm. So bigger is not better. The exact behavior will depend on the JVM implementation.
It is recommended to increase the Java heap space only up to one-half of the total RAM available on the server. Increasing the Java heap space beyond that value can cause performance problems. For example, if your server has 16 GB of RAM available, then the maximum heap space you should use is 8 GB.
The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool. This means that your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.
For G1 GC, it is recommended to explicitly set the maximum and minimum heap size to the same value to avoid dynamic shrinking and growing of the heap during the applications lifecycle.
https://backstage.forgerock.com/knowledge/kb/article/a75965340
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With