RFR: 8302215: G1: Last-ditch Full GC should do serial compaction for tail regions in per thread compaction points. [v2]
Ivan Walulya
iwalulya at openjdk.org
Wed Feb 15 11:29:42 UTC 2023
On Tue, 14 Feb 2023 12:54:46 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Ivan Walulya has updated the pull request incrementally with one additional commit since the last revision:
>>
>> albert review
>
> src/hotspot/share/gc/g1/g1FullCollector.cpp line 382:
>
>> 380: // point. To get maximum compaction and reduce fragmentation, we sort the regions
>> 381: // by hrm_index so that we compact objects to one end of the heap.
>> 382: serial_cp->sort_regions();
>
> I think the intention can be made more explicit by adding higher-index regions to `serial_cp` in order, sth like:
>
>
> for (w : workers) {
> w->cp->filter(< lowest_current_hr);
> }
>
> for i in [lowest_current_hr..max) {
> r = region_at(i);
> if r->is_pinned
> continue;
> serial_cp->add(i);
> }
I can add a comment if its unclear, however, redoing the filtering as above can be extremely unnecessary, especially where heap has very many pinned regions as in the test-case `vmTestbase/vm/gc/compact/Compact_InternedStrings_NonbranchyTree/TestDescription.java`. You have a few regions for serial compaction, and the sorting is sufficient. So I would rather keep the current implementation.
-------------
PR: https://git.openjdk.org/jdk/pull/12529
More information about the hotspot-gc-dev
mailing list