JDK-8297267 : RenaissanceStressTest.java failed with "VirtualMachineError: Out of space in CodeCache for method handle intrinsic"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2022-11-18
  • Updated: 2022-12-30
  • Resolved: 2022-11-21
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The following test failed in the JDK20 CI:

applications/renaissance/RenaissanceStressTest.java

Here's a snippet from the log file:

[stress.process.err] Java HotSpot(TM) 64-Bit Server VM warning: CodeHeap 'non-profiled nmethods' is full. Compiler has been disabled.
[stress.process.err] Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code heap size using -XX:NonProfiledCodeHeapSize=
[stress.process.err] CodeHeap 'non-profiled nmethods': size=120028Kb used=120027Kb max_used=120027Kb free=0Kb
[stress.process.err]  bounds [0x00007f75fc992000, 0x00007f7603ec9000, 0x00007f7603ec9000]
[stress.process.err] CodeHeap 'profiled nmethods': size=120028Kb used=120027Kb max_used=120027Kb free=0Kb
[stress.process.err]  bounds [0x00007f75f4ec9000, 0x00007f75fc400000, 0x00007f75fc400000]
[stress.process.err] CodeHeap 'non-nmethods': size=5704Kb used=1694Kb max_used=1811Kb free=4009Kb
[stress.process.err]  bounds [0x00007f75fc400000, 0x00007f75fc670000, 0x00007f75fc992000]
[stress.process.err]  total_blobs=79076 nmethods=78133 adapters=850
[stress.process.err]  compilation: disabled (not enough contiguous free space left)
[stress.process.err]               stopped_count=1, restarted_count=0
[stress.process.err]  full_count=1
[stress.process.err] WARNING: This benchmark provides no result that can be validated.
[stress.process.err]          There is no way to check that no silent failure occurred.
[stress.process.err] WARNING: This benchmark provides no result that can be validated.
[stress.process.err]          There is no way to check that no silent failure occurred.
[stress.process.err] WARNING: This benchmark provides no result that can be validated.
[stress.process.err]          There is no way to check that no silent failure occurred.
[stress.process.err] WARNING: This benchmark provides no result that can be validated.
[stress.process.err]          There is no way to check that no silent failure occurred.
[stress.process.err] WARNING: This benchmark provides no result that can be validated.
[stress.process.err]          There is no way to check that no silent failure occurred.
[stress.process.err] --------------------------------------------------------------------------------
[stress.process.err] JfrStressModule got uncaught exception in execute at Fri Nov 18 02:26:09 UTC 2022 (1668738369700)
[stress.process.err] java.lang.VirtualMachineError: Out of space in CodeCache for method handle intrinsic
[stress.process.err] 	at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
[stress.process.err] 	at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:1085)
[stress.process.err] 	at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1114)
[stress.process.err] 	at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3663)
[stress.process.err] 	at java.base/java.lang.invoke.Invokers.invokeBasicMethod(Invokers.java:186)
[stress.process.err] 	at java.base/java.lang.invoke.Invokers.basicInvoker(Invokers.java:96)
[stress.process.err] 	at java.base/java.lang.invoke.LambdaForm$NamedFunction.<init>(LambdaForm.java:1106)
[stress.process.err] 	at java.base/java.lang.invoke.LambdaForm$Name.<init>(LambdaForm.java:1359)
[stress.process.err] 	at java.base/java.lang.invoke.LambdaFormEditor.makeArgumentCombinationForm(LambdaFormEditor.java:919)
[stress.process.err] 	at java.base/java.lang.invoke.LambdaFormEditor.filterArgumentsForm(LambdaFormEditor.java:1072)
[stress.process.err] 	at java.base/java.lang.invoke.MethodHandles.argumentsWithCombiner(MethodHandles.java:6162)
[stress.process.err] 	at java.base/java.lang.invoke.MethodHandles.filterArgumentsWithCombiner(MethodHandles.java:6127)
[stress.process.err] 	at java.base/java.lang.invoke.StringConcatFactory.filterInPrependers(StringConcatFactory.java:607)
[stress.process.err] 	at java.base/java.lang.invoke.StringConcatFactory.generateMHInlineCopy(StringConcatFactory.java:539)
[stress.process.err] 	at java.base/java.lang.invoke.StringConcatFactory.makeConcatWithConstants(StringConcatFactory.java:353)
[stress.process.err] 	at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:102)
[stress.process.err] 	at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:315)
[stress.process.err] 	at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:279)
[stress.process.err] 	at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:269)
[stress.process.err] 	at applications.kitchensink.utils.Jfr2Utils.verifyRecording(Jfr2Utils.java:54)
[stress.process.err] 	at applications.kitchensink.process.stress.modules.JfrStressModule.execute(JfrStressModule.java:245)
[stress.process.err] 	at applications.kitchensink.process.stress.modules.StressModule.run(StressModule.java:99)
[stress.process.err] 	at java.base/java.lang.Thread.run(Thread.java:1591)
Comments
https://github.com/openjdk/jdk/pull/10933 has a regression test, now. I hope to get it approved for JDK 20. There's another proposal for a future improvement (JDK-8296336) which needs further investigation.
29-11-2022

Thanks for the report [~dcubed]. The symptoms and context of this failure and that of JDK-8295724 suggest both arise from the same underlying bug. Having a small code cache as in JDK-8295724 probably just makes the failure more likely to happen. I will tentatively close this one as a duplicate of JDK-8295724. If we continue seeing this failure after JDK-8295724 is addressed (there is work in progress and a PR under review, https://github.com/openjdk/jdk/pull/10933), we can reopen this issue.
21-11-2022

This bug has the same error msg: JDK-8295724 VirtualMachineError: Out of space in CodeCache for method handle intrinsic but the test's intention is to have a small code cache. This bug mentions the same error msg: JDK-8269555 Stress tests fail with "Out of space in CodeCache" when executed with C1 only but that bug is focused on C1. This bug is about misc RenaissanceStressTest failures, but this failure mode seemed to be specific enough to warrant a new bug: JDK-8290012 RenaissanceStressTest.java and RenaissanceStressTest24H.java misc failures
18-11-2022