-
Enhancement
-
Resolution: Other
-
P2
-
9
G1 tries to avoid taking too many old gen regions during evacuation to avoid evacuation failure.
It does so by estimating the amount of space the young gen evacuation will take, and subtracting this value from the available free bytes. If the old gen region will still fit, it takes the region, otherwise it will stop adding region to the collection set.
Now if the young gen is > 50% (by e.g. setting G1NewSizePercent > 50), the amount of space taken by the current young gen plus that estimation of the liveness is > 100% of the heap. That means G1 will never evacuate old gen regions, leading to full gc.
JDK-8142935 introduced this code.
It does so by estimating the amount of space the young gen evacuation will take, and subtracting this value from the available free bytes. If the old gen region will still fit, it takes the region, otherwise it will stop adding region to the collection set.
Now if the young gen is > 50% (by e.g. setting G1NewSizePercent > 50), the amount of space taken by the current young gen plus that estimation of the liveness is > 100% of the heap. That means G1 will never evacuate old gen regions, leading to full gc.
- relates to
-
JDK-8153117 Back out JDK-8142935 until JDK-8152723 fixed
- Resolved
-
JDK-8077237 Consider free heap when composing cset for mixed gc
- Open
-
JDK-8142935 Adding old gen regions does not consider available free space
- Closed