RFR: JDK-8262068: Improve G1 Full GC by skipping compaction for regions with high survival ratio [v12]

Thomas Schatzl tschatzl at openjdk.java.net
Tue Mar 30 14:10:21 UTC 2021


On Tue, 30 Mar 2021 12:43:31 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> The reason for this crash is that if there is a young region that is not compacted (because it's mostly full), its BOT (block offset table) is not updated to the extent the verification expects it.
>> 
>> I.e. that verification expects the BOT for old gen regions is completely valid, from start to end of the region. For young regions this is not the case, their BOT is not updated at all (which is normal), just containing a marker indicating that there is no BOT; compaction would take care of this.
>> 
>> The verification does not respect this "after this point the BOT is invalid" marker. There is actually some code in `heapRegion.cpp:724` that intentionally skips young region verification for this purpose. Now that they might be old, this does not work. I think the correct fix is to not try to verify beyond this marker, i.e. change the assignment to `end_card` in `G1BlockOffsetTablePart::verify` accordingly.
>> 
>> Another solution would be to make the region appear like filled with a single large allocation (TLAB).
>> 
>> This is purely to keep the verification happy. All other code correctly handles a partially valid BOT (i.e. valid up to and including that mentioned marker).
>> 
>> I will try out these options.
>
> Hi Thomas, Thank you so much for helping investigate the issue, I will check it tomorrow too.

[Here](https://github.com/tschatzl/jdk/tree/bot-fixes) is a potential fix for this. This needs some discussion on whether an alternatives would be better or not; more of them could be:
* just initialize a dummy BOT for not-compacted young region
* exclude young regions from this dead-wood scheme
In any case this fix should probably go in separately.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2760



More information about the hotspot-gc-dev mailing list