diff options
author | Andreas Gampe <agampe@google.com> | 2014-07-25 16:37:09 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-07-25 16:38:39 -0700 |
commit | 21b4bf89b4454d2af88762200e5d8b42e0d36cf4 (patch) | |
tree | 8ff7a56aface1c79dc55f18c9911d3ca138f5b68 /test/114-ParallelGC | |
parent | 9c81c0cb0dc8c8d8ae5dca3d2d82b0eec7af589f (diff) | |
download | art-21b4bf89b4454d2af88762200e5d8b42e0d36cf4.tar.gz art-21b4bf89b4454d2af88762200e5d8b42e0d36cf4.tar.bz2 art-21b4bf89b4454d2af88762200e5d8b42e0d36cf4.zip |
ART: Fix run-test 114 ParallelGC to account for OOM
This catches any OOMs and doesn't pollute the log.
Bug: 16406852
Change-Id: I1bc95091ccae35a8cb5f2ef0a789f8c8ce5209d0
Diffstat (limited to 'test/114-ParallelGC')
-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; } |