test/hotspot/jtreg/runtime/appcds/LotsOfClasses.java
changeset 52702 10c6e9066819
parent 52631 3009ca99de32
child 52811 ff04b71bf6f1
--- a/test/hotspot/jtreg/runtime/appcds/LotsOfClasses.java	Tue Nov 27 13:39:57 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/LotsOfClasses.java	Tue Nov 27 17:53:17 2018 -0500
@@ -57,9 +57,16 @@
         opts.addSuffix("--add-modules");
         opts.addSuffix("ALL-SYSTEM");
         opts.addSuffix("-Xlog:hashtables");
+        opts.addSuffix("-Xms500m");
+        opts.addSuffix("-Xmx500m");
 
         OutputAnalyzer out = CDSTestUtils.createArchive(opts);
-        CDSTestUtils.checkDump(out);
+        try {
+            CDSTestUtils.checkDump(out);
+        } catch (java.lang.RuntimeException re) {
+            out.shouldContain(
+                "number of memory regions exceeds maximum due to fragmentation");
+        }
     }
 
     static void findAllClasses(ArrayList<String> list) throws Throwable {