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

CDS dumping fails with java heap fragmentation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b23

      Description

      "java -Xshare:dump" would intermittently fail with

         Unable to write archive heap ... due to fragmentation.

      This usually happens when you try to dump lots of classes (e.g. 10000) with a relatively small heap (e.g., 1g) with a lot of GC threads (e.g., 24).

      (Example use case -- Eclipse IDE loads 15,000 classes with 512MB heap.)

      At CDS static archiving dump time, we allocate free GC regions at high address (near or at the top of java heap) for archiving java objects (with G1 currently). If GC happens during the dump time, the java heap might be fragmented with free and used regions interlaced.

      During the object archiving process, we search for a highest free region in the java heap, then allocating downwards starting from the one that's found. If GC activities causes the heap to be fragmented, the consecutive free regions that we find might not be large enough for archiving all selected java objects. In that case, we currently report fragmentation issue and bail out.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iklam Ioi Lam
                Reporter:
                jiangli Jiangli Zhou
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: