Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shipilev committed Oct 21, 2024
1 parent 7158322 commit 6941292
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/hotspot/share/cds/heapShared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,18 @@ class HeapShared: AllStatic {
friend class VerifySharedOopClosure;

public:
// Can this VM write a heap region into the CDS archive? Currently only {G1|Parallel|Serial}+compressed_cp
// Can this VM write a heap region into the CDS archive?
static bool can_write() {
CDS_JAVA_HEAP_ONLY(
if (_disable_writing) {
return false;
}
return (UseG1GC || UseParallelGC || UseSerialGC) && UseCompressedClassPointers;
// Need compressed class pointers for heap region dump.
if (!UseCompressedClassPointers) {
return false;
}
// Almost all GCs support heap region dump, except ZGC (so far).
return !UseZGC;
)
NOT_CDS_JAVA_HEAP(return false;)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ public static void test(String[] args_ignored) throws Exception {
testDump(1, "-XX:+UseZGC", "-XX:-UseCompressedOops", null, false);
}

// Dump heap objects with ParallelGC and SerialGC
// Dump heap objects with Parallel, Serial, Shenandoah GC
testDump(2, "-XX:+UseParallelGC", "", "", false);
testDump(3, "-XX:+UseSerialGC", "", "", false);
testDump(4, "-XX:+UseShenandoahGC", "", "", false);

// Explicitly archive with compressed oops, run without.
testDump(5, "-XX:+UseG1GC", "-XX:+UseCompressedOops", null, false);
Expand Down

0 comments on commit 6941292

Please sign in to comment.