diff options
Diffstat (limited to 'test/114-ParallelGC/src')
-rw-r--r-- | test/114-ParallelGC/src/Main.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/114-ParallelGC/src/Main.java b/test/114-ParallelGC/src/Main.java index 2285872ab0..15d5e50796 100644 --- a/test/114-ParallelGC/src/Main.java +++ b/test/114-ParallelGC/src/Main.java @@ -35,12 +35,19 @@ public class Main implements Runnable { private Main(int id) { this.id = id; + // Allocate this early so it's independent of how the threads are scheduled on startup. + this.l = new ArrayList<Object>(); } public void run() { - List l = new ArrayList(); - for (int i = 0; i < 400; i++) { - l.add(new ArrayList(i)); + for (int i = 0; i < 1000; i++) { + try { + l.add(new ArrayList<Object>(i)); + } catch (OutOfMemoryError oom) { + // Ignore. + } } } + + private List<Object> l; } |