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

Aleksey Shipilev shade at openjdk.org
Fri Jul 11 18:00:45 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

I just dropped the question from the synopsis, though. Because it is clear from the patch there is a problem. You'll need to adjust the PR title a bit.

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

PR Comment: https://git.openjdk.org/jdk/pull/26259#issuecomment-3063226717


More information about the shenandoah-dev mailing list