8166046: [TESTBUG] compiler/stringopts/TestStringObjectInitialization.java fails with OOME
Summary: Reduced heap memory consumption of test.
Reviewed-by: kvn
--- 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();
}
}
}