JDK-8317738 : CodeCacheFullCountTest failed with "VirtualMachineError: Out of space in CodeCache for method handle intrinsic"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-10-09
  • Updated: 2024-11-19
  • Resolved: 2023-10-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 11 JDK 17 JDK 21 JDK 22
11.0.25-oracleFixed 17.0.13-oracleFixed 21.0.5-oracleFixed 22 b20Fixed
Related Reports
Relates :  
Description
The following test failed in the JDK22 CI:

compiler/codecache/CodeCacheFullCountTest.java

Here's a snippet from the log file:

#section:main
----------messages:(7/247)----------
command: main CodeCacheFullCountTest
reason: Assumed action based on file name: run main CodeCacheFullCountTest 
started: Mon Oct 09 12:10:34 GMT 2023
Mode: agentvm
Agent id: 8
finished: Mon Oct 09 12:10:50 GMT 2023
elapsed time (seconds): 15.803
----------configuration:(14/2014)----------

<snip>

----------System.out:(11/3057)----------
Command line: [/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-22+19-1441/macosx-aarch64-debug.jdk/jdk-22/fastdebug/bin/java -cp /System/Volumes/Data/mesos/work_dir/slaves/afbc6042-3a24-4198-9369-18c663a3f74c-S3110/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/e063eb69-0fc3-4587-b989-5350bbf52a25/runs/d534d311-7675-401f-a8bc-13189b6d446c/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_2/classes/0/compiler/codecache/CodeCacheFullCountTest.d:/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-22+19-1441/src.full/open/test/hotspot/jtreg/compiler/codecache:/System/Volumes/Data/mesos/work_dir/slaves/afbc6042-3a24-4198-9369-18c663a3f74c-S3110/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/e063eb69-0fc3-4587-b989-5350bbf52a25/runs/d534d311-7675-401f-a8bc-13189b6d446c/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_2/classes/0/test/lib:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/jtreg.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/junit-platform-console-standalone-1.9.2.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/testng-7.3.0.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/jcommander-1.82.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/guice-5.1.0.jar -XX:MaxRAMPercentage=6.25 -Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/21/35/bundles/macos-aarch64/jdk-21_macos-aarch64_bin.tar.gz/jdk-21.jdk/Contents/Home -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/afbc6042-3a24-4198-9369-18c663a3f74c-S3110/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/e063eb69-0fc3-4587-b989-5350bbf52a25/runs/d534d311-7675-401f-a8bc-13189b6d446c/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_2/tmp -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:-DoEscapeAnalysis -XX:ReservedCodeCacheSize=2496k -XX:-UseCodeCacheFlushing -XX:-MethodFlushing CodeCacheFullCountTest WasteCodeCache ]
[2023-10-09T12:10:49.054214Z] Gathering output for process 9336
[2023-10-09T12:10:50.274942Z] Waiting for completion for process 9336
[2023-10-09T12:10:50.287819Z] Waiting for completion finished for process 9336
Output and diagnostic info for process 9336 was saved into 'pid-9336-output.log'
[2023-10-09T12:10:50.440975Z] Waiting for completion for process 9336
[2023-10-09T12:10:50.441008Z] Waiting for completion finished for process 9336
[2023-10-09T12:10:50.443576Z] Waiting for completion for process 9336
[2023-10-09T12:10:50.443606Z] Waiting for completion finished for process 9336
[2023-10-09T12:10:50.535468Z] Waiting for completion for process 9336
[2023-10-09T12:10:50.535509Z] Waiting for completion finished for process 9336
----------System.err:(29/1639)----------
 stdout: [[1.437s][warning][codecache] CodeCache is full. Compiler has been disabled.
[1.437s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=2496Kb used=2463Kb max_used=2472Kb free=32Kb
 bounds [0x000000010225c000, 0x00000001024cc000, 0x00000001024cc000]
 total_blobs=1214 nmethods=537 adapters=628
 compilation: disabled (not enough contiguous free space left)
              stopped_count=0, restarted_count=0
 full_count=1
];
 stderr: [Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
Java HotSpot(TM) 64-Bit Server VM warning: C2 initialization failed. Shutting down all compilers
Exception in thread "main" java.lang.VirtualMachineError: Out of space in CodeCache for method handle intrinsic

Exception: java.lang.VirtualMachineError thrown from the UncaughtExceptionHandler in thread "main"
]
 exitValue = 1

java.lang.RuntimeException: VM finished with exit code 1
	at CodeCacheFullCountTest.runTest(CodeCacheFullCountTest.java:72)
	at CodeCacheFullCountTest.main(CodeCacheFullCountTest.java:44)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1570)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: VM finished with exit code 1
Comments
Fix request [17u] I backport this for parity with 17.0.13-oracle. No risk, only a test change. Clean backport. Test passes. SAP nightly testing passed.
19-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/3054 Date: 2024-11-18 16:06:47 +0000
18-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/2824 Date: 2024-08-26 22:20:01 +0000
26-08-2024

[jdk21u-fix-request] Approval Request from Amos "Backporting for parity with 21.0.5-oracle. No risk, test fix. Clean backport. Test passes and SAP nightlies pass on 2024-08-15”
16-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/904 Date: 2024-08-08 21:49:05 +0000
08-08-2024

The fix for this bug is integrated in jdk-22+19-1469.
11-10-2023

Changeset: 0fd80711 Author: Tobias Hartmann <thartmann@openjdk.org> Date: 2023-10-11 06:18:34 +0000 URL: https://git.openjdk.org/jdk/commit/0fd807118c9b2cb8381b5c0f5d22d4e3451e8f10
11-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16113 Date: 2023-10-10 07:51:17 +0000
10-10-2023

ILW = Same as JDK-8315576 = P4
09-10-2023

The problem is that the test expects only "Out of space in CodeCache for adapters" but in this case the VM fails with "Out of space in CodeCache for method handle intrinsic" which should be expected as well.
09-10-2023

This should have been fixed by JDK-8315576 in JDK 22 b17, so maybe the fix was incomplete.
09-10-2023