-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 26
-
Component/s: hotspot
nmethod objects in the CodeCache have the following layout:
| CodeBlob header | NMethod header | Constants | MainCode | StubCode | Data/oops |
Although mutable and immutable metadata have already been moved out of the code cache byJDK-8343789 and JDK-8331087 respectively, the embedded `nmethod` header fields still occupy ~160 B (with the `CodeBlob` header adding another 64 B). In JDK25 the total header footprint is 224 B. This space is reserved inside executable memory, which decreases overall executable code density.
This proposal suggests relocation the `nmethod` header to a C-heap-allocated structure and keeping only 8-byte pointer to that header in the CodeCache. The resulting layout would be:
| CodeBlob header | Ptr to NMethodHeader | Constants | MainCode | StubCode | Data/oops |
This change would reduce the size of the CodeCache-resident header from 224 B to 72 B (64 B `CodeBlob` header + 8 B pointer), achieving roughly a 3x reduction in header footprint.
This proposal follows the direction established by JDK-7072317,JDK-8331087 and JDK-8343789.
| CodeBlob header | NMethod header | Constants | MainCode | StubCode | Data/oops |
Although mutable and immutable metadata have already been moved out of the code cache by
This proposal suggests relocation the `nmethod` header to a C-heap-allocated structure and keeping only 8-byte pointer to that header in the CodeCache. The resulting layout would be:
| CodeBlob header | Ptr to NMethodHeader | Constants | MainCode | StubCode | Data/oops |
This change would reduce the size of the CodeCache-resident header from 224 B to 72 B (64 B `CodeBlob` header + 8 B pointer), achieving roughly a 3x reduction in header footprint.
This proposal follows the direction established by JDK-7072317,
- relates to
-
JDK-8328306 AArch64: MacOS lazy JIT "write xor execute" switching
-
- In Progress
-
-
JDK-7072317 move metadata from CodeCache
-
- Open
-
-
JDK-8331087 Move immutable nmethod data from CodeCache
-
- Resolved
-
-
JDK-8343789 Move mutable nmethod data out of CodeCache
-
- Resolved
-
- links to
-
Review(master)
openjdk/jdk/28866