JDK-8034775 : Failing to initialize VM when running with negative value for -XX:CICompilerCount
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs24,hs25
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-02-12
  • Updated: 2015-01-21
  • Resolved: 2014-02-25
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 8 JDK 9
8u40Fixed 9 b04Fixed
Related Reports
Relates :  
Relates :  
Description
Got asked by a member of the vulnerability team if we had a bug on this but I haven't found any.

Running the VM with -XX:CICompilerCount=-1 -XX:-TieredCompilation will lead to creating a GrowablArray with the size -1. When doing raw_allocate for this array we use the size and the element size to calculate how much to allocate and get a native memory allocation failure. Like this:
> java -XX:CICompilerCount=-1 -XX:-TieredCompilation
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 18446744073709551608 bytes for AllocateHeap
# An error report file with more information is saved as:
# /tmp/cms/reproducer/hs_err_pid28802.log

Running with threads equal to -1 should probably not work but we should make sure we verify the input and provide a better error message. 

ILW => MLL => P5