Integrated: 8343789: Move mutable nmethod data out of CodeCache

Boris Ulasevich bulasevich at openjdk.org
Tue Mar 11 12:37:10 UTC 2025


On Tue, 1 Oct 2024 02:10:37 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

> This change relocates mutable data (such as relocations, metadata, jvmci data) from the nmethod. The change follows the recent PR #18984, which relocated immutable nmethod data out of the CodeCache.
> 
> OOPs was initially moved to a new mutable data blob, but then moved back to nmethod due to performance issues on dacapo benchmarks on aarch with ShenandoagGC (why Shenandoah: it is the only GC with supports_instruction_patching=false - it requires loading from the oops table in compiled code, which takes three instructions for a remote data).
> 
> Although performance is not the main focus, testing on AArch64 CPUs, where code density plays a significant role, has shown a 1–2% performance improvement in specific scenarios, such as the CodeCacheStress test and the Renaissance Dotty benchmark.
> 
> The numbers. Immutable data constitutes **~30%** on the nmehtod. Mutable data constitutes **~8%** of nmethod. Example (statistics collected on the CodeCacheStress benchmark):
> - nmethod_count:134000, total_compilation_time: 510460ms
> - total allocation time malloc_mutable/malloc_immutable/CodeCache_alloc: 62ms/114ms/6333ms,
> - total allocation size (mutable/immutable/nmentod): 64MB/192MB/488MB
> 
> Functional testing: jtreg on arm/aarch/x86.
> Performance testing: renaissance/dacapo/SPECjvm2008 benchmarks.
> 
> Alternative solution (see comments): In the future, relocations can be moved to _immutable_data.

This pull request has now been integrated.

Changeset: 83de3404
Author:    Boris Ulasevich <bulasevich at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/83de34041eacdf987988364487712c79bbb4c235
Stats:     192 lines in 7 files changed: 87 ins; 37 del; 68 mod

8343789: Move mutable nmethod data out of CodeCache

Reviewed-by: kvn, dlong

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

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


More information about the hotspot-compiler-dev mailing list