RFR: 8296344: Remove dependency on G1 for writing the CDS archive heap [v6]

Ioi Lam iklam at openjdk.org
Wed Feb 15 02:32:09 UTC 2023


> Goals
> 
> - Simplify the writing of the CDS archive heap
>     - We no longer need to allocate special "archive regions" during CDS dump time. See all the removed G1 code. 
> - Make it possible to (in a future RFE) write the CDS archive heap using any garbage collector
> 
> Implementation - the following runs inside a safepoint so heap objects aren't moving
> 
> - Find all the objects that should be archived
> - Allocate buffer using a GrowableArray
>     - Copy all "open" objects into the buffer
>     - Copy all "closed" objects into the buffer
> - Make sure the heap image can be mapped with all possible G1 region sizes: 
>     - While copying, add fillers to make sure no object spans across 1MB boundary (minimal G1 region size)
>     - Align the bottom of the "open" and "closed" objects at 1MB boundary
> - Write the buffer to disk as the image for the archive heap
> 
> Testing: tiers 1 ~ 5

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:

 - Merge branch 'master' into 8296344-remove-cds-heap-dump-dependency-on-G1-public-review
 - Merge branch 'master' into 8296344-remove-cds-heap-dump-dependency-on-G1-public-review
 - @calvinccheung review comment -- added assert)
 - Simplified relocation by using buffered address instead of requested address
 - @ashu-mehra review; added comments about relocating HeapShared::roots()
 - fixed windows and 32-bit builds which do not support archive heap
 - clean up
 - 8296344: Remove dependency on G1 for writing the CDS archive heap (step 2: no intermediate buffer)
 - 8296344: Remove dependency on G1 for writing the CDS archive heap (step 1: with buffer copying)

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/12304/files
  - new: https://git.openjdk.org/jdk/pull/12304/files/f72e1803..4d3ec2e5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12304&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12304&range=04-05

  Stats: 2795 lines in 93 files changed: 1100 ins; 1434 del; 261 mod
  Patch: https://git.openjdk.org/jdk/pull/12304.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12304/head:pull/12304

PR: https://git.openjdk.org/jdk/pull/12304


More information about the hotspot-dev mailing list