The G1 BOT contains an allocation threshold which basically acts as a "last known valid entry" index for the per-region BOT (which are views on the global BOT table).
Currently G1 BOT verification actually "verifies" the BOT within a region past that BOT index.
This causes issues with young regions; actually there is already code that prevents their BOT verification. This is perfectly fine, allocations in young regions do not update the BOTs.
WithJDK-8262068 this existing filtering of young regions (such that their BOT is not verified) does not work because there may be young regions that are not compacted (so with a BOT that have that last known valid entry at the start of the region) are still labelled as old.
This change proposes to not try to verify the BOT beyond the last known valid index (which is arguably not worth doing), which also covers the existing young filtering.
There are alternatives that may work in particular forJDK-8262068:
a) always compact young regions (which recreates the BOT)
b) create a "dummy" BOT that spans the entire part of the region containing live objects
However they were rejected by me because
option a) takes time and directly counters that optimization for no reason
option b) makes finding the start of an object within these regions slow (they are not refined when there is at least *some* bot)
and finally I do not think there is much point in trying to be clever about areas in the BOT that are known to not contain useful values.
Currently G1 BOT verification actually "verifies" the BOT within a region past that BOT index.
This causes issues with young regions; actually there is already code that prevents their BOT verification. This is perfectly fine, allocations in young regions do not update the BOTs.
With
This change proposes to not try to verify the BOT beyond the last known valid index (which is arguably not worth doing), which also covers the existing young filtering.
There are alternatives that may work in particular for
a) always compact young regions (which recreates the BOT)
b) create a "dummy" BOT that spans the entire part of the region containing live objects
However they were rejected by me because
option a) takes time and directly counters that optimization for no reason
option b) makes finding the start of an object within these regions slow (they are not refined when there is at least *some* bot)
and finally I do not think there is much point in trying to be clever about areas in the BOT that are known to not contain useful values.
- blocks
-
JDK-8262068 Improve G1 Full GC by skipping compaction for regions with high survival ratio
-
- Resolved
-
- relates to
-
JDK-8265056 G1: Keep BOT _next_offset_index in sync with humongous regions' top
-
- Closed
-