RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3]
Kelvin Nilsen
kdnilsen at openjdk.org
Fri Sep 12 18:20:18 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/shenandoahGenerationalEvacuationTask.cpp line 235:
> 233: // is_collector_free range.
> 234: region->restore_top_before_promote();
> 235: size_t region_to_be_used_in_old = region->used();
is region_to_be_used_in_old dead here?
test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java line 162:
> 160: long count = TARGET_MB * 1024 * 1024 / (16 + 4 * size);
> 161:
> 162: long anticipated_humongous_waste_per_array = 124_272;
Define ANTICIPATED_HUMONGOUS_WASTE_PER_ARRAY as a static constant.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2345034798
PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2345081989
More information about the hotspot-gc-dev
mailing list