JDK-8343789 : Move mutable nmethod data out of CodeCache
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2024-11-07
  • Updated: 2025-04-29
  • Resolved: 2025-03-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b14Fixed
Related Reports
Causes :  
Causes :  
Relates :  
Relates :  
Relates :  
Description
Move mutable nmethod's data from the CodeCache to the C heap. The amount of mutable data is ~10% of the CodeCache space. Ideally, the CodeCache should contain only executable code.
Comments
Changeset: 83de3404 Branch: master Author: Boris Ulasevich <bulasevich@openjdk.org> Date: 2025-03-11 12:33:36 +0000 URL: https://git.openjdk.org/jdk/commit/83de34041eacdf987988364487712c79bbb4c235
11-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21276 Date: 2024-10-01 02:10:37 +0000
21-11-2024

> My idea was to move relocation info data (which has big size) into immutable data section of nmethod. Note, the immutable data section of nmethod is allocated in C heap outside CodeCache.
08-11-2024

I don't know what test was used to collect statistic in PR's example. It shows that metadata section (klasses and methods data pointers) can be significant and comparable to relocation info size: relocation = 3437176 (12.846409%) metadata = 2394984 (8.951227%) My experiments with `javac` shows only 3% is used by metadata. If metadata is indeed can be big these changes can be justified. But most importantly these changes should show performance improvement to be completely justified.
08-11-2024

My comment in PR: Note, with JDK-8334691 and other changes I moving into direction to make relocation info data immutable. It is already "immutable" in mainline JDK after JDK-8333819. But it is still mutable in Leyden because we have to patch indexes during publishing AOT nmethod. My idea was to move relocation info data (which has big size) into immutable data section of nmethod. And leave mutable _oops and _metadata together with code since they are relatively small and we need to patch them together with code.
08-11-2024

It is subset of JDK-7072317
08-11-2024

Is this a duplicate of JDK-7072317?
08-11-2024

https://github.com/openjdk/jdk/pull/21276
07-11-2024