JDK-8341649 : Regressions with large metaspace apps after 8338526
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2024-10-07
  • Updated: 2024-12-02
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 24
24Unresolved
Related Reports
Relates :  
Description
While working on apps with a large metaspace size (over 100k classes for example) I saw some regressions that I eventually tracked back to JDK-8338526.
I wrote a JMH to show the problem based on the existing vm/compiler/CodeCacheStress.java which I pushed on a branch here: 
https://github.com/ericcaspole/jdk/blob/JDK-8338526/test/micro/org/openjdk/bench/vm/runtime/MethodHandleStress.java

This JMH can probably simplified and still show the problem, but it's a start.
On our aurora harness it shows 4-18% regressions depending on the platform.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22493 Date: 2024-12-02 17:41:30 +0000
02-12-2024

Making the LambdaForm$MH generated class ABSTRACT is causing the compiler to do a lot of work that it doesn't do with this class FINAL. https://github.com/openjdk/jdk/commit/ad104932e6c26806c353ad048ce5cff7d2b4c29a#diff-3b05b61400e7766115409b3f508d839fb51e450423822252ab2e18543427c764R249 [~thartmann] Do you know why? I'll revert this part of the change. There are still a lot of interface and abstract classes that can be in non-encodable space so still worthwhile, but we really wanted generated classes to go there too. Checking that all methods are static might be too risky for hidden classes, even though it does work.
22-11-2024