JDK-8315576 : compiler/codecache/CodeCacheFullCountTest.java fails after JDK-8314837
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,windows
  • CPU: x86_64
  • Submitted: 2023-09-03
  • Updated: 2024-08-21
  • Resolved: 2023-09-22
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 b17Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8315582 :  
Description
The following test failed in the JDK22 CI:

compiler/codecache/CodeCacheFullCountTest.java

Here's a snippet from the windows-x64 log file:

#section:main
----------messages:(7/255)----------
command: main CodeCacheFullCountTest
reason: Assumed action based on file name: run main CodeCacheFullCountTest 
started: Sat Sep 02 18:59:29 UTC 2023
Mode: agentvm
Agent id: 11
finished: Sat Sep 02 19:00:43 UTC 2023
elapsed time (seconds): 73.269
----------configuration:(14/1427)*----------

<snip>

----------System.out:(11/2484)*----------
Command line: [c:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-22+14-988\\windows-x64-debug.jdk\\jdk-22\\fastdebug\\bin\\java.exe -cp C:\\sb\\prod\\1693681073\\testoutput\\test-support\\jtreg_open_test_hotspot_jtreg_tier1_compiler_2\\classes\\1\\compiler\\codecache\\CodeCacheFullCountTest.d;C:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-22+14-988\\src.full\\open\\test\\hotspot\\jtreg\\compiler\\codecache;C:\\sb\\prod\\1693681073\\testoutput\\test-support\\jtreg_open_test_hotspot_jtreg_tier1_compiler_2\\classes\\1\\test\\lib;C:\\ade\\mesos\\work_dir\\jib-master\\install\\jtreg\\7.3.1\\1\\bundles\\jtreg-7.3.1+1.zip\\jtreg\\lib\\jtreg.jar;C:\\ade\\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;C:\\ade\\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;C:\\ade\\mesos\\work_dir\\jib-master\\install\\jtreg\\7.3.1\\1\\bundles\\jtreg-7.3.1+1.zip\\jtreg\\lib\\jcommander-1.82.jar;C:\\ade\\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=4.16667 -Dtest.boot.jdk=c:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk\\20\\36\\bundles\\windows-x64\\jdk-20_windows-x64_bin.zip\\jdk-20 -Djava.io.tmpdir=c:\\sb\\prod\\1693681073\\testoutput\\test-support\\jtreg_open_test_hotspot_jtreg_tier1_compiler_2\\tmp -XX:+CreateCoredumpOnCrash -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:ReservedCodeCacheSize=2496k -XX:-UseCodeCacheFlushing -XX:-MethodFlushing CodeCacheFullCountTest WasteCodeCache ]
[2023-09-02T19:00:38.965600Z] Gathering output for process 36248
[2023-09-02T19:00:41.809922700Z] Waiting for completion for process 36248
[2023-09-02T19:00:41.825559200Z] Waiting for completion finished for process 36248
Output and diagnostic info for process 36248 was saved into 'pid-36248-output.log'
[2023-09-02T19:00:42.294304500Z] Waiting for completion for process 36248
[2023-09-02T19:00:42.294304500Z] Waiting for completion finished for process 36248
[2023-09-02T19:00:42.294304500Z] Waiting for completion for process 36248
[2023-09-02T19:00:42.294304500Z] Waiting for completion finished for process 36248
[2023-09-02T19:00:42.559920400Z] Waiting for completion for process 36248
[2023-09-02T19:00:42.559920400Z] Waiting for completion finished for process 36248
----------System.err:(48/3371)----------
 stdout: [[3.310s][warning][codecache] CodeCache is full. Compiler has been disabled.
[3.310s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=2496Kb used=2485Kb max_used=2492Kb free=10Kb
 bounds [0x0000029879550000, 0x00000298797c0000, 0x00000298797c0000]
 total_blobs=1085 nmethods=414 adapters=619
 compilation: disabled (not enough contiguous free space left)
              stopped_count=0, restarted_count=0
 full_count=1
Error occurred during initialization of VM
java.lang.InternalError: java.lang.VirtualMachineError: Out of space in CodeCache for adapters
	at jdk.internal.reflect.MethodHandleIntegerFieldAccessorImpl.getInt(java.base/MethodHandleIntegerFieldAccessorImpl.java:86)
	at java.lang.reflect.Field.getInt(java.base/Field.java:628)
	at java.lang.invoke.MethodHandleNatives.verifyConstants(java.base/MethodHandleNatives.java:226)
	at java.lang.invoke.MethodHandleNatives.<clinit>(java.base/MethodHandleNatives.java:245)
Caused by: java.lang.VirtualMachineError: Out of space in CodeCache for adapters
	at jdk.internal.org.objectweb.asm.ClassWriter.visitMethod(java.base/ClassWriter.java:500)
	at java.lang.invoke.InvokerBytecodeGenerator.methodPrologue(java.base/InvokerBytecodeGenerator.java:280)
	at java.lang.invoke.InvokerBytecodeGenerator.addMethod(java.base/InvokerBytecodeGenerator.java:766)
	at java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCodeBytes(java.base/InvokerBytecodeGenerator.java:754)
	at java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCode(java.base/InvokerBytecodeGenerator.java:712)
	at java.lang.invoke.LambdaForm.compileToBytecode(java.base/LambdaForm.java:849)
	at java.lang.invoke.Invokers.invokeHandleForm(java.base/Invokers.java:358)
	at java.lang.invoke.Invokers.methodHandleInvokeLinkerMethod(java.base/Invokers.java:263)
	at java.lang.invoke.MethodHandleNatives.linkMethodImpl(java.base/MethodHandleNatives.java:494)
	at java.lang.invoke.MethodHandleNatives.linkMethod(java.base/MethodHandleNatives.java:485)
	at jdk.internal.reflect.MethodHandleIntegerFieldAccessorImpl.getInt(java.base/MethodHandleIntegerFieldAccessorImpl.java:77)
	at java.lang.reflect.Field.getInt(java.base/Field.java:628)
	at java.lang.invoke.MethodHandleNatives.verifyConstants(java.base/MethodHandleNatives.java:226)
	at java.lang.invoke.MethodHandleNatives.<clinit>(java.base/MethodHandleNatives.java:245)

];
 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
]
 exitValue = 1

java.lang.RuntimeException: VM finished with exit code 1
	at CodeCacheFullCountTest.runTest(CodeCacheFullCountTest.java:64)
	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

The test task's JVM args are:
-Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation


Here's a snippet from the linux-x64 log file:

#section:main
----------messages:(7/248)----------
command: main CodeCacheFullCountTest
reason: Assumed action based on file name: run main CodeCacheFullCountTest 
started: Sat Sep 02 17:47:55 UTC 2023
Mode: agentvm
Agent id: 10
finished: Sat Sep 02 17:48:27 UTC 2023
elapsed time (seconds): 31.748
----------configuration:(14/1918)----------

<snip>

----------System.out:(11/2939)----------
Command line: [/opt/mach5/mesos/work_dir/jib-master/install/jdk-22+14-988/linux-x64-debug.jdk/jdk-22/fastdebug/bin/java -cp /opt/mach5/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S141880/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/9c635776-e490-45d4-b151-e522aef8407f/runs/61362d7b-4e67-4df9-841f-a19f4427bb0a/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_2/classes/5/compiler/codecache/CodeCacheFullCountTest.d:/opt/mach5/mesos/work_dir/jib-master/install/jdk-22+14-988/src.full/open/test/hotspot/jtreg/compiler/codecache:/opt/mach5/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S141880/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/9c635776-e490-45d4-b151-e522aef8407f/runs/61362d7b-4e67-4df9-841f-a19f4427bb0a/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_2/classes/5/test/lib:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/jtreg.jar:/opt/mach5/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:/opt/mach5/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:/opt/mach5/mesos/work_dir/jib-master/install/jtreg/7.3.1/1/bundles/jtreg-7.3.1+1.zip/jtreg/lib/jcommander-1.82.jar:/opt/mach5/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=4.16667 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/20/36/bundles/linux-x64/jdk-20_linux-x64_bin.tar.gz/jdk-20 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S141880/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/9c635776-e490-45d4-b151-e522aef8407f/runs/61362d7b-4e67-4df9-841f-a19f4427bb0a/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_2/tmp -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:ReservedCodeCacheSize=2496k -XX:-UseCodeCacheFlushing -XX:-MethodFlushing CodeCacheFullCountTest WasteCodeCache ]
[2023-09-02T17:48:24.556715168Z] Gathering output for process 21606
[2023-09-02T17:48:26.325267526Z] Waiting for completion for process 21606
[2023-09-02T17:48:26.358926488Z] Waiting for completion finished for process 21606
Output and diagnostic info for process 21606 was saved into 'pid-21606-output.log'
[2023-09-02T17:48:26.625647668Z] Waiting for completion for process 21606
[2023-09-02T17:48:26.625711545Z] Waiting for completion finished for process 21606
[2023-09-02T17:48:26.628803880Z] Waiting for completion for process 21606
[2023-09-02T17:48:26.628852353Z] Waiting for completion finished for process 21606
[2023-09-02T17:48:26.790326096Z] Waiting for completion for process 21606
[2023-09-02T17:48:26.790374059Z] Waiting for completion finished for process 21606
----------System.err:(48/3467)----------
 stdout: [[2.231s][warning][codecache] CodeCache is full. Compiler has been disabled.
[2.231s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=2496Kb used=2477Kb max_used=2484Kb free=18Kb
 bounds [0x00007f5e16b62000, 0x00007f5e16dd2000, 0x00007f5e16dd2000]
 total_blobs=1068 nmethods=403 adapters=614
 compilation: disabled (not enough contiguous free space left)
              stopped_count=0, restarted_count=0
 full_count=1
Error occurred during initialization of VM
java.lang.InternalError: java.lang.VirtualMachineError: Out of space in CodeCache for adapters
	at jdk.internal.reflect.MethodHandleIntegerFieldAccessorImpl.getInt(java.base@22-ea/MethodHandleIntegerFieldAccessorImpl.java:86)
	at java.lang.reflect.Field.getInt(java.base@22-ea/Field.java:628)
	at java.lang.invoke.MethodHandleNatives.verifyConstants(java.base@22-ea/MethodHandleNatives.java:226)
	at java.lang.invoke.MethodHandleNatives.<clinit>(java.base@22-ea/MethodHandleNatives.java:245)
Caused by: java.lang.VirtualMachineError: Out of space in CodeCache for adapters
	at jdk.internal.org.objectweb.asm.ClassWriter.visitMethod(java.base@22-ea/ClassWriter.java:500)
	at java.lang.invoke.InvokerBytecodeGenerator.methodPrologue(java.base@22-ea/InvokerBytecodeGenerator.java:280)
	at java.lang.invoke.InvokerBytecodeGenerator.addMethod(java.base@22-ea/InvokerBytecodeGenerator.java:766)
	at java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCodeBytes(java.base@22-ea/InvokerBytecodeGenerator.java:754)
	at java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCode(java.base@22-ea/InvokerBytecodeGenerator.java:712)
	at java.lang.invoke.LambdaForm.compileToBytecode(java.base@22-ea/LambdaForm.java:849)
	at java.lang.invoke.Invokers.invokeHandleForm(java.base@22-ea/Invokers.java:358)
	at java.lang.invoke.Invokers.methodHandleInvokeLinkerMethod(java.base@22-ea/Invokers.java:263)
	at java.lang.invoke.MethodHandleNatives.linkMethodImpl(java.base@22-ea/MethodHandleNatives.java:494)
	at java.lang.invoke.MethodHandleNatives.linkMethod(java.base@22-ea/MethodHandleNatives.java:485)
	at jdk.internal.reflect.MethodHandleIntegerFieldAccessorImpl.getInt(java.base@22-ea/MethodHandleIntegerFieldAccessorImpl.java:77)
	at java.lang.reflect.Field.getInt(java.base@22-ea/Field.java:628)
	at java.lang.invoke.MethodHandleNatives.verifyConstants(java.base@22-ea/MethodHandleNatives.java:226)
	at java.lang.invoke.MethodHandleNatives.<clinit>(java.base@22-ea/MethodHandleNatives.java:245)

];
 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
]
 exitValue = 1

java.lang.RuntimeException: VM finished with exit code 1
	at CodeCacheFullCountTest.runTest(CodeCacheFullCountTest.java:64)
	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

The test task's JVM args are:
-Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation
Comments
[jdk17u-fix-request] Approval Request from Amos "Backporting for parity with 17.0.13-oracle. No risk, test fix. Un-Clean backport. Test passes and SAP nightlies pass on 2024-08-17”
17-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/2808 Date: 2024-08-15 21:54:29 +0000
15-08-2024

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

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/751 Date: 2024-06-19 02:39:17 +0000
19-06-2024

Changeset: 343cc0ce Author: Yi-Fan Tsai <yftsai@amazon.com> Committer: Tobias Hartmann <thartmann@openjdk.org> Date: 2023-09-22 07:57:05 +0000 URL: https://git.openjdk.org/jdk/commit/343cc0ce2bba797e206f6b7312018a8c6d1bdb66
22-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15604 Date: 2023-09-06 21:54:24 +0000
06-09-2023

ILW = Test fails (test bug), single test with -Xcomp (will be problem listed), no workaround = MLH = P4
04-09-2023

[~yftsai], could you please have a look? Thanks.
04-09-2023

These test failures first appeared in jdk-22+14-988-tier6 which included the fix for: JDK-8314837 5 compiled/codecache tests ignore VM flags
03-09-2023