RFR: 8361948: Shenandoah: region free capacity unit mismatch (byte or word?)

Aleksey Shipilev shade at openjdk.org
Fri Jul 11 17:58:22 UTC 2025


On Fri, 11 Jul 2025 07:12:31 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

> In the code path of [mutator allocation](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp#L883
> ), looks like we assume that ShenandoahAllocRequest::size/min_size and region free capacity have same unit, which is apparently not right, unit used in ShenandoahAllocRequest is word but region free capacity is in bytes.
> 
> It should be just one line change like:
> 
> if (alloc_capacity(r) >= min_size * HeapWordSize) {
>    ...
> }
> 
> 
> 
> ### Test
> - [x] make test TEST=hotspot_gc_shenandoah

This looks reasonable.

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

Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26259#pullrequestreview-3009267508


More information about the shenandoah-dev mailing list