RFR: 8361948: Shenandoah: region free capacity unit mismatch

William Kemper wkemper at openjdk.org
Fri Jul 11 18:50:42 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

Nice catch!

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

Marked as reviewed by wkemper (Reviewer).

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


More information about the shenandoah-dev mailing list