hotspot/src/share/vm/runtime/arguments.cpp
changeset 13739 35cd081a64ea
parent 13728 882756847a04
child 13861 619cff4bfb8b
child 13757 8740ce357087
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Sep 07 12:04:16 2012 -0400
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Sep 07 16:42:25 2012 -0400
@@ -1427,6 +1427,16 @@
     // if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
     //   FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
     // }
+    // Set the ClassMetaspaceSize to something that will not need to be
+    // expanded, since it cannot be expanded.
+    if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
+      // 100,000 classes seems like a good size, so 100M assumes around 1K
+      // per klass.   The vtable and oopMap is embedded so we don't have a fixed
+      // size per klass.   Eventually, this will be parameterized because it
+      // would also be useful to determine the optimal size of the
+      // systemDictionary.
+      FLAG_SET_ERGO(uintx, ClassMetaspaceSize, 100*M);
+    }
   }
   // Also checks that certain machines are slower with compressed oops
   // in vm_version initialization code.
@@ -1965,6 +1975,9 @@
 
   status = status && verify_object_alignment();
 
+  status = status && verify_min_value(ClassMetaspaceSize, 1*M,
+                                      "ClassMetaspaceSize");
+
   return status;
 }
 
@@ -2916,7 +2929,7 @@
                             (UseLargePages && FLAG_IS_CMDLINE(UseLargePages));
   if (cannot_share) {
     if (must_share) {
-        warning("disabling large pages%s"
+        warning("disabling large pages %s"
                 "because of %s", "" LP64_ONLY("and compressed oops "),
                 DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
         FLAG_SET_CMDLINE(bool, UseLargePages, false);