Usage:
You can set the desired percentage of survivor space used after scavenge with:
-XX:TargetSurvivorRatio=percent , where percent is the desired value in %.
Since:
Starting from JDK 6.
Examples:
This will instruct JVM to use 20% of survivor space used after scavenge:
-XX:TargetSurvivorRatio=20
Description:
This flag sets the maximum survivor space usage percentage. When this limit is reached, all remaining live objects will be promoted to Tenured generation regardless of their age.
The first condition of live object tenuring (promoted from survivor space into Tenured generation). When a live object has reached the tenuring threshold age, it will be promoted into Tenured generation.
However, there another condition that triggers object tenuring. When the survivor space usage has reached target ratio defined by another option called "-XX:TargetSurvivorRatio", remaining live objects, regardless of their age, will be promoted into Tenured generation. This case is also called premature tenuring (or premature promotion).
The Serial collector, uses "-XX:TargetSurvivorRatio=50" as the default, which says, I need to keep my survivor space usage below 50%. This seems to be a big waste of heap memory.
Default Value:
Default is 50%.
Errors:
The value should be between 0 and 100.
Arguments related:
UseG1GC, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, UseSerialGC, USeParNewGC, UseParallelGC, UseZGC
Related Posts:
Edit your Comment