Integrated: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration

Xiaolong Peng xpeng at openjdk.org
Thu Nov 6 19:01:23 UTC 2025


On Wed, 29 Oct 2025 05:29:14 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

> To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice:
> 1. fast path: traverse regions between left most and right most in the partition,  and try to allocate in an affiliated region in the partition;  
> 2. if fails in fast path, traverse regions between left most empty and right most empty in the partition, and try try to allocate in a FREE region.
> 
> 2 can be saved if we also remember the first FREE region seem in 1.
> 
> The PR makes the code much cleaner, and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference) 
> 
> 
> Test:
> - [x] hotspot_gc_shenandoah

This pull request has now been integrated.

Changeset: 9cc542eb
Author:    Xiaolong Peng <xpeng at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/9cc542ebcb81552fe8c32a8cc3c63332853e5127
Stats:     77 lines in 2 files changed: 18 ins; 45 del; 14 mod

8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration

Reviewed-by: wkemper

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

PR: https://git.openjdk.org/jdk/pull/28036


More information about the hotspot-gc-dev mailing list