mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8166046: [TESTBUG] compiler/stringopts/TestStringObjectInitialization.java fails with OOME
Reduced heap memory consumption of test. Reviewed-by: kvn
This commit is contained in:
parent
5b54998a23
commit
466c23ffe0
1 changed files with 7 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue