Hands-On High Performance with Spring 5
by Chintan Mehta, Subhash Shah, Pritesh Shah, Prashant Goswami, Dinesh Radadiya
-XX:NewRatio
We can set the size of the Young Generation as a ratio of the Old Generation using the -XX:NewRatio option. The benefit we can get with this option could be that the Young Generation can grow and shrink when JVM adjusts the total heap size during execution. -XX:NewRatio means the ratio of Old Generation is larger than the Young Generation. -XX:NewRatio=2 means the size of the Old Generation is twice that of the Young Generation, which further means that the Young Generation is 1/3 of the total heap.
If we specify ratio and a fixed size for the Young Generation, then the fixed size will take precedence. There is no generation rule regarding which method of specifying the size of the Young Generation is preferable. The rule of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access