Profile Image
vishnupriya

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

What is Young generation heap size: -XX:NewSize? 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-newsize

  • x-newsize

  • Young generation heap size

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

You can reserve heap size for the young generation:

 

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

 

Examples:

 

Set newSize to 512 bytes:

 

java -XX:NewSize =512

 

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 minimum size of the YG is 1310 MB, and maximum size is unlimited.

 

Default Value:

 

Default 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-newsize

  • x-newsize

  • Young generation heap size