Profile Image
vishnupriya

What is G1 garbage collector tuning: -XX:G1ReservePercent?

What is G1 garbage collector tuning: -XX:G1ReservePercent? 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?

  • jvmargument

  • xx-g1reservepercent

  • x-g1reservepercent

  • G1 garbage collector tuning

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

You can set the initial size (in bytes) of the memory allocation pool:

 

-XX: G1ReservePercent=percent,  where percent is desired percent of the heap from 0 to 50 that's reserved as a false ceiling.

 

Examples:

 

To set the reserved heap to 20% use:

 

-XX:G1ReservePercent=20

 

Description:

 

G1 (Garbage First) GC is designed for apps in multi-processor environments with large memory space (more than 4GB). It is available from the JDK7 Update 4. Unlike other collectors, the G1 collector partitions the heap into a set of equal-sized heap regions (usually 1MB to 32MB) chunks, prioritizes them, and then performs the garbage collection on those chunks based on the priority. We can tune G1 with additional options, one of them is G1ReservePercent. It sets the percentage of the heap (0 to 50) that's reserved as a false ceiling to reduce the possibility of promotion failure for the G1 collector. When you increase or decrease the percentage, ensure that you adjust the total Java heap by the same amount. By default, this option is set to 10%.

 

Default Value:

 

Default value is 10%.

 

Errors:

 

None

 

Arguments related:

 

TODO link MaxHeapSize, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, NewSize

 

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
  • jvmargument

  • xx-g1reservepercent

  • x-g1reservepercent

  • G1 garbage collector tuning