8024945: Remove check on minimum size of MetaspaceSize
authorjmasa
Mon, 13 Jun 2016 14:10:09 -0700
changeset 39692 57f307f875e0
parent 39691 8ebf84c4be69
child 39694 e8e42da000c5
8024945: Remove check on minimum size of MetaspaceSize Reviewed-by: kbarrett, tschatzl
hotspot/src/share/vm/memory/metaspace.cpp
hotspot/test/gc/metaspace/TestMetaspaceInitialization.java
hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Tue Jun 28 00:24:10 2016 +0900
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Mon Jun 13 14:10:09 2016 -0700
@@ -3106,10 +3106,6 @@
 
   assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize");
 
-  if (MetaspaceSize < 256*K) {
-    vm_exit_during_initialization("Too small initial Metaspace size");
-  }
-
   MinMetaspaceExpansion = align_size_down_bounded(MinMetaspaceExpansion, _commit_alignment);
   MaxMetaspaceExpansion = align_size_down_bounded(MaxMetaspaceExpansion, _commit_alignment);
 
--- a/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java	Tue Jun 28 00:24:10 2016 +0900
+++ b/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java	Mon Jun 13 14:10:09 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,11 +24,11 @@
 import java.util.ArrayList;
 
 /* @test TestMetaspaceInitialization
- * @bug 8042933
+ * @bug 8024945
  * @summary Tests to initialize metaspace with a very low MetaspaceSize
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -XX:MetaspaceSize=2m TestMetaspaceInitialization
+ * @run main/othervm -XX:MetaspaceSize=0 TestMetaspaceInitialization
  */
 public class TestMetaspaceInitialization {
     private class Internal {
--- a/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java	Tue Jun 28 00:24:10 2016 +0900
+++ b/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java	Mon Jun 13 14:10:09 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,9 +47,6 @@
     // 8024650: MaxMetaspaceSize was adjusted instead of MetaspaceSize.
     testMaxMetaspaceSizeLTMetaspaceSize(MAX_ALIGNMENT, MAX_ALIGNMENT * 2);
     testMaxMetaspaceSizeGTMetaspaceSize(MAX_ALIGNMENT * 2, MAX_ALIGNMENT);
-    testTooSmallInitialMetaspace(0, 0);
-    testTooSmallInitialMetaspace(0, MAX_ALIGNMENT);
-    testTooSmallInitialMetaspace(MAX_ALIGNMENT, 0);
   }
 
   private static void testMaxMetaspaceSizeEQMetaspaceSize(long maxMetaspaceSize, long metaspaceSize) throws Exception {
@@ -73,11 +70,6 @@
     Asserts.assertEQ(mf.metaspaceSize, metaspaceSize);
   }
 
-  private static void testTooSmallInitialMetaspace(long maxMetaspaceSize, long metaspaceSize) throws Exception {
-    OutputAnalyzer output = run(maxMetaspaceSize, metaspaceSize);
-    output.shouldContain("Too small initial Metaspace size");
-  }
-
   private static MetaspaceFlags runAndGetValue(long maxMetaspaceSize, long metaspaceSize) throws Exception {
     OutputAnalyzer output = run(maxMetaspaceSize, metaspaceSize);
     output.shouldNotMatch("Error occurred during initialization of VM\n.*");