--- 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") \
\