RFR: 8361099: Shenandoah: Improve heap lock contention by using CAS for memory allocation [v17]

Kelvin Nilsen kdnilsen at openjdk.org
Wed Jan 7 00:36:17 UTC 2026


On Tue, 6 Jan 2026 00:33:57 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahAllocator.cpp line 41:
>> 
>>> 39:   _alloc_region_count(alloc_region_count), _free_set(free_set), _alloc_partition_name(ShenandoahRegionPartitions::partition_name(ALLOC_PARTITION)) {
>>> 40:   if (alloc_region_count > 0) {
>>> 41:     _alloc_regions = PaddedArray<ShenandoahAllocRegion, mtGC>::create_unfreeable(alloc_region_count);
>> 
>> Rethinking about the the PaddedArray used here, we may not really need it.
>> Allocator has multiple shared alloc regions for CAS, and only refreshes them when all of them run out of usable memory, so _alloc_regions won't be frequently updated, the PaddedArray here should have a negative performance impact.
>
> Are you running any experiments (on different hardware configurations) to test your assumptions about this?

Please document the results of any experiments as rationale for the final design.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26171#discussion_r2666275536


More information about the hotspot-gc-dev mailing list