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

Thomas Schatzl tschatzl at openjdk.java.net
Fri Mar 26 10:54:26 UTC 2021


On Fri, 26 Mar 2021 09:30:13 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp line 49:
>> 
>>> 47:     // by _region_attr_table, so here we use _region_attr_table rather than
>>> 48:     // HeapRegion itself to tell whether a region is pinned.
>>> 49:     if (!_collector->is_in_pinned_or_closed(hr_index)) {
>> 
>> The original code uses only `r->is_pinned()`, not `r->is_pinned_or_closed()`.
>> This predicate is wrong, `closed` regions may not be pinned (but can be, and in most cases are).
>
> I'm not sure, but per code suggests in src/hotspot/share/gc/g1/heapRegionType.hpp, seems closed region should be a pinned as well. Or miss something? Would you mind to clarify this point?
>     ArchiveMask           = 32,
>     OpenArchiveTag        = ArchiveMask | PinnedMask,
>     ClosedArchiveTag      = ArchiveMask | PinnedMask + 1

Just because a `ClosedArchive` region is by default pinned at this time, it does not mean it will be in the future. There are no immediate plans for that, but I can think of some edge cases where it could be useful.

The correct (and intended) predicate for this check in this context is `is_pinned()`, although at the moment they have the same effect.

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

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



More information about the hotspot-gc-dev mailing list