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

Rui Li duke at openjdk.org
Tue Dec 9 22:48:44 UTC 2025


On Fri, 5 Dec 2025 19:34:12 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> Rui Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove unused freeset includes
>
> 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`

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

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


More information about the hotspot-gc-dev mailing list