JDK-8343789 : Move mutable nmethod data out of CodeCache
Type:Enhancement
Component:hotspot
Sub-Component:compiler
Affected Version:24
Priority:P4
Status:Open
Resolution:Unresolved
OS:generic
CPU:generic
Submitted:2024-11-07
Updated:2024-11-08
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.
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
> 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.