RFR: 8367731: G1: Make G1CollectionSet manage the young gen cset group

Albert Mingkun Yang ayang at openjdk.org
Fri Sep 19 07:37:03 UTC 2025


On Tue, 16 Sep 2025 10:15:55 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change that lets the collection set manage the young cset candidate group directly. Currently everywhere the collection set (not "containing" the young cset candidate group) is used, we immediately do the same thing for the young gen candidate group in the same place.
> 
> This makes it kind of natural to put together (and the `G1CollectionSet` already manages adding new regions to the young gen cset group anyway, so that split in responsibility is questionable anyway).
> 
> Testing: gha
> 
> Thanks,
>   Thomas

A minor issue but up to you.

src/hotspot/share/gc/g1/g1CollectionSet.cpp line 103:

> 101: 
> 102: void G1CollectionSet::abandon() {
> 103:   _g1h->young_regions_cset_group()->clear(true /* uninstall_cset_group */);

It's a bit odd that `CollectionSet` doesn't have direct access to `cset_group` and have to go through heap.

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

Marked as reviewed by ayang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27312#pullrequestreview-3243581067
PR Review Comment: https://git.openjdk.org/jdk/pull/27312#discussion_r2362048509


More information about the hotspot-gc-dev mailing list