RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3]
Kelvin Nilsen
kdnilsen at openjdk.org
Wed Sep 10 20:45:00 UTC 2025
On Tue, 9 Sep 2025 22:07:11 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet.
>> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet.
>>
>> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms.
>>
>> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>
> another tweak to make GHA gtest happy
src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 372:
> 370: _last_sample_time = now;
> 371: _last_sample_value = allocated;
> 372: }
This was a bug. If we don't update the average, we should not restart the time until next sample and we should not overwrite the value of _last_sample_value.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2337848793
More information about the hotspot-gc-dev
mailing list