RFR: 8250989: Consolidate buffer allocation code for CDS static/dynamic dumping [v4]
Ioi Lam
iklam at openjdk.java.net
Sun Feb 7 05:27:10 UTC 2021
> Before this PR, when a static CDS archive is dumped, we would 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. this also unnecessarily complicates Metaspace::global_initialize().
>
> After this PR, both we first load all the classes and then allocate a buffer with an appropriate size.
>
> I also simplified the pointer relocation code that prepares the archive to be mapped at the "requested location" (usually 0x800000000), and improved the comments.
>
> We used to have lots of special cases for adjusting pointers during dynamic dump. All of those are removed.
>
> Reviewers, please start with
> - Header comments in archiveBuilder.hpp that describe the overall process of archive dumping
> - `MetaspaceShared::initialize_for_static_dump()`
> - `ArchiveBuilder::reserve_buffer()`
> - Comments around `RelocateBufferToRequested` in archiveBuilder.cpp
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 10 additional commits since the last revision:
- Merge branch 'master' into 8250989-consolidate-dump-buffer-alloc
- fixed tier4 failure; fixed typo in comments
- @coleenp and @tstuefe comments
- Merge branch 'master' into 8250989-consolidate-dump-buffer-alloc
- @calvinccheung and @tstuefe comments
- fixed whitespace
- clean up and comments
- move remaining functions to archiveBuilder.cpp
- renamed "default" to "requested"
- started
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/2296/files
- new: https://git.openjdk.java.net/jdk/pull/2296/files/aa4079bb..eb12582e
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2296&range=03
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2296&range=02-03
Stats: 962 lines in 18 files changed: 757 ins; 168 del; 37 mod
Patch: https://git.openjdk.java.net/jdk/pull/2296.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2296/head:pull/2296
PR: https://git.openjdk.java.net/jdk/pull/2296
More information about the hotspot-runtime-dev
mailing list