-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 thumb here is that if you know the size of the objects generated by our application, then specify the fixed size, otherwise, specify the ratio. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset