Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8234693 Consolidate CDS static and dynamic archive dumping code
  3. JDK-8250989

Consolidate buffer allocation code for CDS static/dynamic dumping

    XMLWordPrintable

Details

    • b09

    Description

      When a static CDS archive is dumped, we unconditionally allocate a 4GB ReservedSpace and use that as the buffer for writing the archive content. We usually don't need such a big ReservedSpace. It also unnecessarily complicates Metaspace::global_initialize().

      http://hg.openjdk.java.net/jdk/jdk/file/4d36e29a5410/src/hotspot/share/memory/metaspaceShared.cpp#l286

      When a dynamic CDS archive is dumped, we allocate a buffer that's just big enough. That way we are less likely to run out of memory:

      http://hg.openjdk.java.net/jdk/jdk/file/4d36e29a5410/src/hotspot/share/memory/dynamicArchive.cpp#l730

      It makes no sense to have two different buffer allocation code. We should always use the second variant since it's more frugal and less intrusive.

      Attachments

        Issue Links

          Activity

            People

              iklam Ioi Lam
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: