Integrated: 8345687: Improve the implementation of SegmentFactories::allocateSegment

Quan Anh Mai qamai at openjdk.org
Tue Mar 18 09:02:16 UTC 2025


On Fri, 6 Dec 2024 16:30:47 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> Hi,
> 
> This patch improves the performance of a typical `Arena::allocate` in several ways:
> 
> - Delay the creation of the NativeMemorySegmentImpl. This avoids the merge of the instance with the one obtained from the call in the uncommon path, increasing the chance the object being scalar replaced.
> - Split the allocation of over-aligned memory to a slow-path method.
> - Align the memory to 8 bytes, allowing faster zeroing.
> - Use a dedicated method to zero the just-allocated native memory, reduce code size and make it more straightforward.
> - Make `VM.pageAlignDirectMemory` a `Boolean` instead of a `boolean` so that `false` value can be constant folded.
> 
> Please take a look and leave your reviews, thanks a lot.

This pull request has now been integrated.

Changeset: e1bcff3a
Author:    Quan Anh Mai <qamai at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e1bcff3ada9214940e9c71ba4ed5ba93d0218af2
Stats:     72 lines in 4 files changed: 27 ins; 17 del; 28 mod

8345687: Improve the implementation of SegmentFactories::allocateSegment

Reviewed-by: jvernee, mcimadamore

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

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


More information about the core-libs-dev mailing list