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

Combine CDS archive heap into a single block

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 20
    • hotspot
    • b20

      In JDK 20, the CDS archive can consists of up to 4 blocks of memory

      - one or two blocks of "open" type, and one or two blocks of "closed" type

      After JDK-8296344, we will always have a single block of "open" and a single block of "closed".

      Still, having the two separate blocks makes the runtime mapping code complicated. Also, G1 has special handling for the "archive regions" used for mapping these blocks. See

      https://github.com/openjdk/jdk/blob/6065696e5df2cde8c313083217ead3417d04c365/src/hotspot/share/gc/g1/heapRegionType.hpp#L80-L91

      It's unclear that such special handling has any performance benefit. Objects in the CDS archive heap are expected to have a long lifecycle and are infrequently modified. It should be sufficient to place these objects into the old generation (for any generational collector, not just G1).

      ********************************
      Proposal:

      - Combine all objects in the CDS archive heap into a single, contiguous block.

      - Remove "archive region" handling from G1

      - At runtime, allocate one or several contiguous G1 regions for mapping the CDS archive heap. These regions are marked as in the old generation.

      *********************************
      Similar mapping code will be implemented in other collectors in follow-up RFEs.


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

              Created:
              Updated:
              Resolved: