RFR: 8372543: Shenandoah: undercalculated the available size when soft max takes effect [v3]

Kelvin Nilsen kdnilsen at openjdk.org
Mon Dec 15 19:57:55 UTC 2025


On Tue, 9 Dec 2025 22:46:07 GMT, Rui Li <duke at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 940:
>> 
>>> 938: 
>>> 939: size_t ShenandoahGeneration::soft_available_exclude_evac_reserve() const {
>>> 940:   size_t result = available(ShenandoahHeap::heap()->soft_max_capacity() * (100.0 - ShenandoahEvacReserve) / 100);
>> 
>> I'm a little uncomfortable with this approach.  It's mostly a question of how we name it.  The evac reserve is not always this value.  In particular, we may shrink the young evac reserves after we have selected the cset.  Also of concern is that if someone invokes this function on old_generation(), it looks like they'll get a bogus (not meaningful) value.
>> 
>> I think I'd be more comfortable with naming this to something like "mutator_available_when_gc_is_idle()".  If we keep it virtual, then OldGeneration should override with "assert(false, "Not relevant to old generation")
>
> Talked offline. Rename this to `soft_mutator_available`

Thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28622#discussion_r2620646753


More information about the hotspot-gc-dev mailing list