From e970ddbc60aadf170dc22b19b86ddbf965bf5ea4 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Mon, 5 Jun 2023 18:33:54 +0000 Subject: [PATCH] 8309170: CDS archive heap is always relocated for larger heap Reviewed-by: stuefe, iklam --- src/hotspot/share/memory/virtualspace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/memory/virtualspace.cpp b/src/hotspot/share/memory/virtualspace.cpp index 4ce12b888a0..ae898bec3af 100644 --- a/src/hotspot/share/memory/virtualspace.cpp +++ b/src/hotspot/share/memory/virtualspace.cpp @@ -551,7 +551,7 @@ void ReservedHeapSpace::initialize_compressed_heap(const size_t size, size_t ali const size_t class_space = align_up(CompressedClassSpaceSize, alignment); // For small heaps, save some space for compressed class pointer // space so it can be decoded with no base. - if (UseCompressedClassPointers && !UseSharedSpaces && + if (UseCompressedClassPointers && !UseSharedSpaces && !DumpSharedSpaces && OopEncodingHeapMax <= KlassEncodingMetaspaceMax && (uint64_t)(aligned_heap_base_min_address + size + class_space) <= KlassEncodingMetaspaceMax) { zerobased_max = (char *)OopEncodingHeapMax - class_space;