Add experimental switch to force ccs to a specific address stuefe-new-metaspace-branch
authorstuefe
Tue, 29 Oct 2019 12:07:19 +0100
branchstuefe-new-metaspace-branch
changeset 58839 d888a9d9f9a5
parent 58838 55ce65813b62
child 58840 7678903a348f
Add experimental switch to force ccs to a specific address
src/hotspot/share/memory/metaspace.cpp
src/hotspot/share/runtime/globals.hpp
--- a/src/hotspot/share/memory/metaspace.cpp	Tue Oct 29 08:56:10 2019 +0100
+++ b/src/hotspot/share/memory/metaspace.cpp	Tue Oct 29 12:07:19 2019 +0100
@@ -824,6 +824,10 @@
 #ifdef _LP64
     if (using_class_space()) {
       char* base = (char*)align_up(CompressedOops::end(), _reserve_alignment);
+      if (ForceCompressedClassSpaceStartAddress != 0) {
+        base = (char*)ForceCompressedClassSpaceStartAddress;
+        log_debug(gc, metaspace)("Forcing class space start address to " PTR_FORMAT ".", p2i(base));
+      }
       allocate_metaspace_compressed_klass_ptrs(base, 0);
     }
 #endif // _LP64
--- a/src/hotspot/share/runtime/globals.hpp	Tue Oct 29 08:56:10 2019 +0100
+++ b/src/hotspot/share/runtime/globals.hpp	Tue Oct 29 12:07:19 2019 +0100
@@ -1610,6 +1610,9 @@
           "class pointers are used")                                        \
           range(1*M, 3*G)                                                   \
                                                                             \
+  experimental(uintx, ForceCompressedClassSpaceStartAddress, 0,             \
+          "Force class space start address to a given value.")              \
+                                                                            \
   product(ccstr, MetaspaceReclaimStrategy, "balanced",                      \
           "options: balanced, aggressive, none")                            \
                                                                             \