< prev index next >

test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java

Print this page
rev 60538 : imported patch jep387-test.patch

@@ -34,15 +34,18 @@
 
 public class MaxMetaspaceSizeTest {
     public static void main(String... args) throws Exception {
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
             "-Xmx1g",
-            "-XX:InitialBootClassLoaderMetaspaceSize=4195328",
-            "-XX:MaxMetaspaceSize=4195328",
+            "-XX:MaxMetaspaceSize=4K",
             "-XX:+UseCompressedClassPointers",
             "-XX:CompressedClassSpaceSize=1g",
             "--version");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
-        output.shouldContain("MaxMetaspaceSize is too small.");
+        // We do not explicitly limit MaxMetaspaceSize to a lower minimum. User can get as low as he wants.
+        // However, you most certainly will hit either one of
+        // "OutOfMemoryError: Metaspace" or
+        // "OutOfMemoryError: Compressed class space"
+        output.shouldMatch("OutOfMemoryError.*(Compressed class space|Metaspace)");
         output.shouldNotHaveExitValue(0);
     }
 }
< prev index next >