JDK-8276036 : The value of full_count in the message of insufficient codecache is wrong
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,18
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2021-10-27
  • Updated: 2024-06-28
  • Resolved: 2021-11-03
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 18
11.0.25-oracleFixed 17.0.10-oracleFixed 18 b23Fixed
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Microsoft Windows [Version 10.0.19041.1237]

A DESCRIPTION OF THE PROBLEM :
The value of full_count in the message of insufficient codecache is 0 even though a codecache shortage occurred.
full_count is the number of times the code heap was full.
This issue is common to all operating systems.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
javac WasteCodeCache.java
java -XX:ReservedCodeCacheSize=2496k -XX:-UseCodeCacheFlushing WasteCodeCache

EXPECTED OUTPUT :
[16.139s][warning][codecache] CodeCache is full. Compiler has been disabled.
[16.140s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
OpenJDK 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
OpenJDK 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=2496Kb used=2180Kb max_used=2300Kb free=315Kb
 bounds [0x0000028b91320000, 0x0000028b91590000, 0x0000028b91590000]
 total_blobs=1277 nmethods=971 adapters=217
 compilation: disabled (not enough contiguous free space left)
              stopped_count=1, restarted_count=0
 full_count=1

ACTUAL :
[16.139s][warning][codecache] CodeCache is full. Compiler has been disabled.
[16.140s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
OpenJDK 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
OpenJDK 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=2496Kb used=2180Kb max_used=2300Kb free=315Kb
 bounds [0x0000028b91320000, 0x0000028b91590000, 0x0000028b91590000]
 total_blobs=1277 nmethods=971 adapters=217
 compilation: disabled (not enough contiguous free space left)
              stopped_count=1, restarted_count=0
 full_count=0
Comments
[jdk11u-fix-request] Approval Request from Martin Should get backported for parity with 11.0.25-oracle. The backport is recognized as clean and tier 1-4 have passed.
27-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2818 Date: 2024-06-26 15:36:32 +0000
26-06-2024

[jdk17u-fix-request] Approval Request from Elif Aslan “Clean backport. Fix a wrong value of full_count in the message of insufficient codecache Low risk. GHA tested”
20-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1742 Date: 2023-09-14 23:01:52 +0000
19-09-2023

Changeset: 61cb4bc6 Author: Tobias Holenstein <tobias.holenstein@oracle.com> Committer: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-11-03 15:31:50 +0000 URL: https://git.openjdk.java.net/jdk/commit/61cb4bc6b0252536364a86f38ff2e5c8c7ab610b
03-11-2021

[~dlong] Sure, I will give it a try. Thanks
28-10-2021

ILW = incorrect output = LMH = P5
27-10-2021

[~tholenstein], this looks like a starter bug. Would you like to take it?
27-10-2021

Since this is codecache related, I'm moving this bug from hotspot/runtime -> hotspot/compiler.
27-10-2021

The logic is basically: if (full_count == 0) { // not reported yet print everything } full_count++ // heap->report_full() we can probably increment the count first.
27-10-2021