Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8034775

Failing to initialize VM when running with negative value for -XX:CICompilerCount

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 9
    • hs24, hs25
    • hotspot
    • b04

        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

              anoll Albert Noll (Inactive)
              sjohanss Stefan Johansson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: