Date: Thu, 8 Jun 2023 20:44:16 +0800
Subject: [PATCH 27/59] 8193386: CompressedClassSize too large with MaxMetaspace

Bug url: https://bugs.openjdk.org/browse/JDK-8193386
---
 hotspot/src/share/vm/memory/metaspace.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp
index 4a3f2a9ab..cc5bd4544 100644
--- a/hotspot/src/share/vm/memory/metaspace.cpp
+++ b/hotspot/src/share/vm/memory/metaspace.cpp
@@ -3572,7 +3572,6 @@ void Metaspace::ergo_initialize() {
   MaxMetaspaceExpansion = align_size_down_bounded(MaxMetaspaceExpansion, _commit_alignment);
 
   CompressedClassSpaceSize = align_size_down_bounded(CompressedClassSpaceSize, _reserve_alignment);
-  set_compressed_class_space_size(CompressedClassSpaceSize);
 
   // Initial virtual space size will be calculated at global_initialize()
   uintx min_metaspace_sz =
@@ -3591,6 +3590,7 @@ void Metaspace::ergo_initialize() {
                   min_metaspace_sz);
   }
 
+  set_compressed_class_space_size(CompressedClassSpaceSize);
 }
 
 void Metaspace::global_initialize() {
-- 
2.22.0

