Remove always-use-class-space feature stuefe-new-metaspace-branch
authorstuefe
Tue, 10 Sep 2019 14:31:38 +0200
branchstuefe-new-metaspace-branch
changeset 58069 ba98d1dccf30
parent 58067 b83deb51ea70
child 58070 2cecbd566968
Remove always-use-class-space feature
src/hotspot/share/memory/metaspace.cpp
src/hotspot/share/memory/metaspace/classLoaderMetaspace.cpp
src/hotspot/share/memory/metaspace/settings.cpp
src/hotspot/share/memory/metaspace/settings.hpp
src/hotspot/share/runtime/globals.hpp
--- a/src/hotspot/share/memory/metaspace.cpp	Tue Sep 10 12:53:00 2019 +0200
+++ b/src/hotspot/share/memory/metaspace.cpp	Tue Sep 10 14:31:38 2019 +0200
@@ -747,7 +747,7 @@
   } else {
     vm_exit_during_initialization("Invalid value for MetaspaceReclaimStrategy: \"%s\".", MetaspaceReclaimStrategy);
   }
-  metaspace::Settings::initialize(strat, MetaspaceAlwaysUseClassSpace);
+  metaspace::Settings::initialize(strat);
 
   if (DumpSharedSpaces) {
     // Using large pages when dumping the shared archive is currently not implemented.
--- a/src/hotspot/share/memory/metaspace/classLoaderMetaspace.cpp	Tue Sep 10 12:53:00 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/classLoaderMetaspace.cpp	Tue Sep 10 14:31:38 2019 +0200
@@ -43,7 +43,7 @@
 
 static bool use_class_space(bool is_class) {
   if (Metaspace::using_class_space()) {
-    if (is_class || Settings::always_use_class_space()) {
+    if (is_class) {
       return true;
     }
   }
@@ -69,7 +69,7 @@
       "non-class sm");
 
   // If needed, initialize class spacemanager
-  if (Metaspace::using_class_space() || Settings::always_use_class_space()) {
+  if (Metaspace::using_class_space()) {
     _class_space_manager = new SpaceManager(
         ChunkManager::chunkmanager_class(),
         ChunkAllocSequence::alloc_sequence_by_space_type(space_type, true),
--- a/src/hotspot/share/memory/metaspace/settings.cpp	Tue Sep 10 12:53:00 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/settings.cpp	Tue Sep 10 14:31:38 2019 +0200
@@ -52,9 +52,8 @@
 bool Settings::_uncommit_on_purge = false;
 size_t Settings::_uncommit_on_purge_min_word_size = 0;
 
-bool Settings::_always_use_class_space = false;
 
-void Settings::initialize(strategy_t strat, bool always_use_class_space) {
+void Settings::initialize(strategy_t strat) {
 
   switch (strat) {
   case strategy_no_reclaim:
@@ -131,7 +130,6 @@
   // strategy. This is rather arbitrarily choosen.
   _enlarge_chunks_in_place = true;
   _enlarge_chunks_in_place_max_word_size = 256 * K;
-  _always_use_class_space = always_use_class_space;
 
 
   // Sanity checks.
@@ -165,7 +163,6 @@
   st->print_cr(" - uncommit_on_purge: %d.", (int)uncommit_on_purge());
   st->print_cr(" - uncommit_on_purge_min_word_size: " SIZE_FORMAT ".", uncommit_on_purge_min_word_size());
 
-  st->print_cr(" - always_use_class_space: %d.", always_use_class_space());
 
 }
 
--- a/src/hotspot/share/memory/metaspace/settings.hpp	Tue Sep 10 12:53:00 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/settings.hpp	Tue Sep 10 14:31:38 2019 +0200
@@ -84,14 +84,6 @@
   // Must be a multiple of and not smaller than commit granularity.
   static size_t _uncommit_on_purge_min_word_size;
 
-  // experimental: If CompressedClassPointers is on, all allocations live in class space.
-  //
-  // This reduces fragmentation, number of chunks and waste by a moderate amount. It will shift all
-  // allocations to class space - also those not addressed by compressed pointers. For many use cases
-  // this may be a valid solution since their metaspace usage can usually be served with the default
-  // size of 1G compressed class space.
-  static bool _always_use_class_space;
-
 public:
 
   static size_t commit_granule_bytes()                        { return _commit_granule_bytes; }
@@ -125,13 +117,10 @@
 
   };
 
-  static void initialize(strategy_t theme, bool always_use_class_space);
+  static void initialize(strategy_t theme);
 
   static void print_on(outputStream* st);
 
-  // Non-strategy-related settings
-  static bool always_use_class_space()                        { return _always_use_class_space; }
-
 };
 
 } // namespace metaspace
--- a/src/hotspot/share/runtime/globals.hpp	Tue Sep 10 12:53:00 2019 +0200
+++ b/src/hotspot/share/runtime/globals.hpp	Tue Sep 10 14:31:38 2019 +0200
@@ -1616,9 +1616,6 @@
   product(ccstr, MetaspaceReclaimStrategy, "balanced",                      \
           "options: balanced, aggressive, none")                            \
                                                                             \
-  product(bool, MetaspaceAlwaysUseClassSpace, false,                        \
-          "If true, use class space exclusively.")                          \
-                                                                            \
   manageable(uintx, MinHeapFreeRatio, 40,                                   \
           "The minimum percentage of heap free after GC to avoid expansion."\
           " For most GCs this applies to the old generation. In G1 and"     \