diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2015-01-26 16:05:11 -0800 |
---|---|---|
committer | Hiroshi Yamauchi <yamauchi@google.com> | 2015-01-26 16:08:16 -0800 |
commit | 779e70568986ef27fca17671ebdb66af2ce843f5 (patch) | |
tree | 8dd49c65dfc48c7a3de5795804f271496c57d19c /test/114-ParallelGC | |
parent | 2ca19c23b9bc64c743a4cdbe9282ad4d995b398d (diff) | |
download | art-779e70568986ef27fca17671ebdb66af2ce843f5.tar.gz art-779e70568986ef27fca17671ebdb66af2ce843f5.tar.bz2 art-779e70568986ef27fca17671ebdb66af2ce843f5.zip |
Fix 114-ParallelGC.
In main(), the outer ArrayList may still be reachable after the
try-catch under the interpreter or a compiler without a liveness
analysis and the last ArrayList allocation may fail due to an OOME.
This fixes 114-ParallelGC under the CC and the GSS collectors.
Bug: 12687968
Change-Id: Ie1082d38b2a677ec70fdc23b0187ae8ce0612808
Diffstat (limited to 'test/114-ParallelGC')
-rw-r--r-- | test/114-ParallelGC/src/Main.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/114-ParallelGC/src/Main.java b/test/114-ParallelGC/src/Main.java index df2243c27f..46029cf26a 100644 --- a/test/114-ParallelGC/src/Main.java +++ b/test/114-ParallelGC/src/Main.java @@ -53,13 +53,17 @@ public class Main implements Runnable { } // Allocate objects to definitely run GC before quitting. + ArrayList<Object> l = new ArrayList<Object>(); try { - ArrayList<Object> l = new ArrayList<Object>(); for (int i = 0; i < 100000; i++) { l.add(new ArrayList<Object>(i)); } } catch (OutOfMemoryError oom) { } + // Make the (outer) ArrayList unreachable. Note it may still + // be reachable under an interpreter or a compiler without a + // liveness analysis. + l = null; new ArrayList<Object>(50); } |