Profile Image
vishnupriya

What is Tuning garbage collection: -XX:InitialSurvivorRatio?

What is Tuning garbage collection: -XX:InitialSurvivorRatio? 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-initialsurvivorratio

  • x-initialsurvivorratio

  • Tuning garbage collection

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

You can set the initial survivor space ratio used by the throughput garbage collector with:

 

-XX:InitialSurvivorRatio=size, where size is the desired ratio of your choice.

 

Examples:

 

To set the initial survivor space ratio to 4 use:

 

-XX:InitialSurvivorRatio=4

 

Description:

 

Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the -XX:+UseParallelGC option). Adaptive sizing is enabled by default with the throughput garbage collector by using the -XX:+UseParallelGC option, and the survivor space is resized according to the application behavior, starting with the initial value. If adaptive sizing is disabled (using the -XX:-UseAdaptiveSizePolicy option), then the -XX:SurvivorRatio option should be used to set the size of the survivor space for the entire execution of the application.

 

The following formula can be used to calculate the initial size of survivor space (S) based on the size of the young generation (Y), and the initial survivor space ratio (R):

 

    S=Y/(R+2)

 

The 2 in the equation denotes two survivor spaces. The larger the value specified as the initial survivor space ratio, the smaller the initial survivor space size.

 

By default, the initial survivor space ratio is set to 8. If the default value for the young generation space size is used (2 MB), then the initial size of the survivor space is 0.2 MB.

 

Default Value:

 

Default value is 8.

 

Errors:

 

None

 

Arguments related:

 

TODO link UseParallelGC, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, InitialHeapSize

 

 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-initialsurvivorratio

  • x-initialsurvivorratio

  • Tuning garbage collection