Profile Image
vishnupriya

What is Young generation heap size: -XX:MaxNewSize?

What is Young generation heap size: -XX:MaxNewSize? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvm-argument

  • xx-maxnewsize

  • x-maxnewsize

  • Young generation heap size

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

You can set max heap size for the young generation:

 

-XX:MaxNewSizet=<young size>[unit] , where unit can be k,m,g for kilobytes, megabytes gigabytes or without prefix for bytes.

 

Examples:

 

Set MaxNewSize to 512 megabytes:

 

java -XX:NewSize =512m

 

Description:

 

According to Oracle’s documentation, one of the most important tuning options is the proportion of the heap reserved for the Young Generation. It is minimum size of young generation which is allocated at JVM startup.  By default, the maximum size of the YG is 1310 MB, and maximum size is unlimited.

 

Default Value:

 

Default value is Xmx/5

 

Errors:

 

None

 

Arguments related:

 

TODO link ParallelGCThreads, MaxGCPauseMillis , GCTimeRatio, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, MaxNewSize

 

Related Posts:

NOTE:

 

If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm-argument

  • xx-maxnewsize

  • x-maxnewsize

  • Young generation heap size