JDK-8060479 : [TESTBUG] compiler/codecache/CheckSegmentedCodeCache.java test fails with product build
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-10-14
  • Updated: 2015-06-03
  • Resolved: 2014-10-24
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
Blocks :  
Description
The test 'compiler/codecache/CheckSegmentedCodeCache.java' fails in PIT with 'Not enough space in non-nmethod code heap to run VM' missing from stdout/stderr.

The problem is that the test expects the VM to always exit with an error message at startup if a ReservedCodeCacheSize of 1700K is specified:
Command line: [java -XX:+SegmentedCodeCache -XX:ReservedCodeCacheSize=1700K -XX:InitialCodeCacheSize=100K ]

This is only true for debug builds but does not hold for product builds (see 'min_code_cache_size' in 'CodeCache::initialize_heaps()'). The test has to check for the build type and adjust the ReservedCodeCacheSize accordingly to trigger the error message.
Comments
This is a testbug and not related to JDK-8060196. The problem is that with a product build a ReservedCodeCacheSize of 1700K is not small enough to trigger the error during VM initialization.
15-10-2014

In the log there is a warning from VM: - Java HotSpot(TM) Server VM warning: CodeHeap 'profiled nmethods' is full. Compiler has been disabled. CodeHeap 'profiled nmethods': size=4Kb used=0Kb max_used=0Kb free=4Kb bounds [0xb62fe000, 0xb62ff000, 0xb62ff000] It seems that in product builds the following condition was not true in the hotspot/src/share/vm/code/codeCache.cpp: 196: if (NonNMethodCodeHeapSize < (min_code_cache_size + code_buffers_size)) { 197: vm_exit_during_initialization("Not enough space in non-nmethod code heap to run VM."); 198: }
14-10-2014

Could be duplicate of 8060196
14-10-2014