RFR: 8338440: Parallel: Improve fragmentation mitigation in Full GC
Albert Mingkun Yang
ayang at openjdk.org
Fri Aug 23 08:54:03 UTC 2024
On Thu, 22 Aug 2024 12:30:29 GMT, Guoxiong Li <gli at openjdk.org> wrote:
>> Extend `SplitInfo` to support more fine-grained splitting to mitigate the fragmentation issue during full GC. Added comments and diagrams in the process.
>>
>> For easier review, it's best to start with `SplitInfo` and then proceed to see how it is constructed in `summarize_split_space` and consumed in `first_src_addr`. The accompanying diagrams should help create a clear mental image.
>>
>> With this patch, the exec time of `runtime/ClassInitErrors/TestOutOfMemoryDuringInit.java` using Parallel drops from ~30s to ~8s, the same as other GCs, and gc-log shows similar number of GC cycles as well.
>>
>> Test: tier1-8, systemgc micro bm, CacheStress, dacapo, specjbb2005, specjvm2008
>
> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 524:
>
>> 522: log_warning(gc)("Uncleared Region: %u", cur_idx);
>> 523: region(cur_idx)->verify_clear();
>> 524: }
>
> In `PSParallelCompact::clear_data_covering_space --> ParallelCompactData::clear_range`, the `ParallelCompactData::_region_data` is set to `0` directly. I don't know whether it is worth adding two methods `ParallelCompactData::RegionData::is_clear/verify_clear` to verify. And the previous implementation can verify the field `RegionData::_pushed` as well.
It's mostly for easier debugging. During dev of this patch, if this assertion fails, it's unclear which field is problematic, so I went for this new impl.
`RegionData::_pushed` has only a single mutating place, which performs verification already, so I think it's fine not to verify it here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20590#discussion_r1728622460
More information about the hotspot-gc-dev
mailing list