RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration [v2]
William Kemper
wkemper at openjdk.org
Fri Oct 31 20:57:05 UTC 2025
On Fri, 31 Oct 2025 15:29:05 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 901:
>>
>>> 899: }
>>> 900:
>>> 901: bool allow_new_region = can_allocate_in_new_region(req);
>>
>> Are we losing the check here? Before this change, the region had to be `FREE` _and_ the generation affiliated with the request had to have `free_unaffiliated_regions`.
>
> I was confused about this part, if we can find a FREE region in the partition, why we still need to test if the generation must have free_unaffiliated_regions, I can add can_allocate_in_new_region back to retain the original behavior.
The young and old collector reserves both have `FREE` regions, but we need to make sure we don't exceed the reserves for one or the other.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28036#discussion_r2482658205
More information about the hotspot-gc-dev
mailing list