RFR: 8341371: CDS cannot load archived heap objects with -XX:+UseSerialGC -XX:-UseCompressedOops
Ioi Lam
iklam at openjdk.org
Wed Oct 23 05:04:05 UTC 2024
On Tue, 22 Oct 2024 19:32:03 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
> [JDK-8298614](https://bugs.openjdk.org/browse/JDK-8298614) enabled writing the archived heap region with SerialGC and ParallelGC, but archives written with XX:-UseCompressedOops can't be loaded at runtime. This patch enables heap loading for SerialGC and ParallelGC as well as EpsilonGC and Shenandoah since they were enabled in [JDK-8341913](https://bugs.openjdk.org/browse/JDK-8341913). Related tests were updated to check for the new conditions. Verified with tier 1-5 tests.
Changes requested by iklam (Reviewer).
src/hotspot/share/cds/archiveHeapLoader.cpp line 245:
> 243: }
> 244: };
> 245:
This new class looks almost the same as the existing PatchUncompressedEmbeddedPointers class. I think you can change PatchUncompressedEmbeddedPointers to take an additional `intx runtime_offset` parameter in its constructor, which will be `loaded_region->_runtime_offset` or `ArchiveHeapLoader::mapped_heap_delta()`.
src/hotspot/share/cds/filemap.cpp line 2137:
> 2135: FileMapRegion* r = region_at(MetaspaceShared::hp);
> 2136: assert(is_aligned(r->mapping_offset(), sizeof(HeapWord)), "must be");
> 2137: assert(ArchiveHeapLoader::can_use(), "cannot be used by ArchiveHeapLoader::can_load() mode");
The error message needs to be updated.
src/hotspot/share/prims/whitebox.cpp line 2162:
> 2160:
> 2161: WB_ENTRY(jboolean, WB_CanWriteJavaHeapArchive(JNIEnv* env))
> 2162: return HeapShared::can_write() && ArchiveHeapLoader::can_use();
Do we still need the `&& ArchiveHeapLoader::can_use()` part?
-------------
PR Review: https://git.openjdk.org/jdk/pull/21647#pullrequestreview-2387142172
PR Review Comment: https://git.openjdk.org/jdk/pull/21647#discussion_r1811841631
PR Review Comment: https://git.openjdk.org/jdk/pull/21647#discussion_r1811844617
PR Review Comment: https://git.openjdk.org/jdk/pull/21647#discussion_r1811846134
More information about the hotspot-dev
mailing list