hotspot/test/compiler/stringopts/TestStringObjectInitialization.java
changeset 41332 a1ff82a6136a
parent 40059 c2304140ed64
--- a/hotspot/test/compiler/stringopts/TestStringObjectInitialization.java	Tue Sep 20 16:50:37 2016 -0700
+++ b/hotspot/test/compiler/stringopts/TestStringObjectInitialization.java	Wed Sep 21 08:14:46 2016 +0200
@@ -67,6 +67,11 @@
         add(s + Arrays.toString(sArray) + " const ");
     }
 
+    public void reset() {
+        // Reset string to avoid OOMEs
+        myString = "";
+    }
+
     private static class Runner implements Runnable {
         private TestStringObjectInitialization test;
 
@@ -76,8 +81,9 @@
 
         public void run() {
             String[] array = {"a", "b", "c"};
-            for (int i = 0; i < 10000; ++i) {
+            for (int i = 0; i < 100_000; ++i) {
                 test.run("a", array);
+                test.reset();
             }
         }
     }