JDK-8060196 : 'CodeHeap is full' warning suggests to increase wrong code heap size
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-10-13
  • Updated: 2015-06-03
  • Resolved: 2014-10-17
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 9
9 b40Fixed
Related Reports
Relates :  
Description
[2014-10-11T20:19:20.63] Java HotSpot(TM) 64-Bit Server VM warning: CodeHeap 'non-nmethods' is full. Compiler has been disabled.
[2014-10-11T20:19:20.63] Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code heap size using -XX:ProfiledCodeHeapSize=
[2014-10-11T20:19:20.64] CodeHeap 'non-nmethods': size=8568Kb used=8068Kb max_used=8068Kb free=499Kb
[2014-10-11T20:19:20.64]  bounds [0xffffffff66800000, 0xffffffff67050000, 0xffffffff6705e000]
[2014-10-11T20:19:20.64] CodeHeap 'profiled nmethods': size=118600Kb used=49728Kb max_used=49728Kb free=68871Kb
[2014-10-11T20:19:20.64]  bounds [0xffffffff6705e000, 0xffffffff6a19e000, 0xffffffff6e430000]
[2014-10-11T20:19:20.64] CodeHeap 'non-profiled nmethods': size=118600Kb used=8792Kb max_used=8806Kb free=109807Kb
[2014-10-11T20:19:20.64]  bounds [0xffffffff6e430000, 0xffffffff6ecd0000, 0xffffffff75802000]
[2014-10-11T20:19:20.64]  total_blobs=13382 nmethods=8544 adapters=4756
[2014-10-11T20:19:20.64]  compilation: disabled (not enough contiguous free space left)

The suggestion "Try increasing the code heap size using -XX:ProfiledCodeHeapSize=" should be "Try increasing the code heap size using -XX:NonNMethodCodeHeapSize=" .
Comments
Adapted bug title and description. The original problem, i.e. that compilation is disabled even if we can still store non-nmethod code in the non-profiled code heap, will be fixed with JDK-8046809 which removes the CodeCache::is_full() method. I will only fix the 'code heap is full' warning here (it suggests to increase the profiled code heap size instead of the non-nmethod code heap size).
16-10-2014

The problem is that CodeCache::is_full() returns true if the non-nmethod code heap is full, even if we still have space in the non-profiled code heap. The bug can be reproduced with: java -Xcomp -XX:CodeCacheMinimumFreeSpace=3500K -version
13-10-2014