8166046: [TESTBUG] compiler/stringopts/TestStringObjectInitialization.java fails with OOME

Reduced heap memory consumption of test.

Reviewed-by: kvn
This commit is contained in:
Tobias Hartmann 2016-09-21 08:14:46 +02:00
parent 5b54998a23
commit 466c23ffe0

View file

@ -67,6 +67,11 @@ public class TestStringObjectInitialization {
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 class TestStringObjectInitialization {
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();
}
}
}