O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

-XX:NewSize and -XX:MaxNewSize

We can set the size of the Young Generation using -XX:MaxNewSize. The Young Generation resides under the total heap memory and the Old Generation size will be smaller if we set the size of the Young Generation as large. The Young Generation size should never be larger than the Old Generation for stability reasons. Thus, -Xmx/2 is the maximum size we can set for -XX:MaxNewSize.

To achieve better performance, set the initial size of the Young Generation by setting the -XX:NewSize flag. This saves some costs in terms of the Young Generation growing to that size over time.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required