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

resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java can fail if GC occurs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 19, repo-loom
    • Fix Version/s: 19
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b08

      Description

      resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java is failing in the loom repo, even when not using the vthread wrapper:

          java.lang.RuntimeException: 'truncating to' missing from stdout/stderr

      The test is pretty simple. The target app creates a very large array:

              int[] hugeArray = new int[Integer.MAX_VALUE/2];

      When doing a heap dump, the following is expected in the output but is missing for some reason:

      WARNING: Cannot dump array of type int with length 1073741823; truncating to length 1073741819

      This doesn't happen when specifying no VM args, but does with the following args:

      -Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation

      This also happens with just -Xcomp. It's unclear why the warning message is not produced. 1073741823 * 4 is 0x7fffffff. Add some room for the object header and the overall size of the object exceeds SA's limit, which is why SA would normally truncate it to 1073741819. Why in this case it is not exceeding the limit is unclear. Possibly the object is not even being dump, so the warning message is never triggered.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cjplummer Chris Plummer
              Reporter:
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: