RFR: 8048180: G1: Eager reclaim of humongous objects with references [v4]

Thomas Schatzl tschatzl at openjdk.org
Thu Oct 9 13:01:29 UTC 2025


On Thu, 9 Oct 2025 12:49:49 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Maybe the title should have `G1: ` prefix?

It's a very old enhancement. Fixed.

> src/hotspot/share/gc/g1/g1YoungCollector.cpp line 401:
> 
>> 399:       bool mark_in_progress = _g1h->collector_state()->mark_in_progress();
>> 400:       return (obj->is_typeArray() || (G1EagerReclaimWithRefs && (allocated_after_mark_start || !mark_in_progress))) &&
>> 401:              _g1h->is_potential_eager_reclaim_candidate(region);
> 
> I'd suggest rewriting this a bit (e.g. using early-return or sth) -- the current form is not super clear.

Are you okay with removing the `G1EagerReclaimWithRefs` flag? Then it becomes a bit easier by itself.

The logical or does not lend itself very well to early returns.

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

PR Comment: https://git.openjdk.org/jdk/pull/27525#issuecomment-3385743346
PR Review Comment: https://git.openjdk.org/jdk/pull/27525#discussion_r2416713016


More information about the hotspot-gc-dev mailing list