diff options
author | Mathieu Chartier <mathieuc@google.com> | 2012-11-19 14:43:58 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2012-11-19 14:43:58 -0800 |
commit | 2eb840353822092d542361c8d6c4938acfddee8e (patch) | |
tree | ecc1b9bccf69455ef727becf4b043aa6e1a6c8cc | |
parent | 6aa852b927a12ba16f5c05ee7d044ac1372feb7f (diff) | |
download | android_art-2eb840353822092d542361c8d6c4938acfddee8e.tar.gz android_art-2eb840353822092d542361c8d6c4938acfddee8e.tar.bz2 android_art-2eb840353822092d542361c8d6c4938acfddee8e.zip |
Fix 080-oom-throw println failing.
System.println would occasionally fail since it does small allocations. This is
fixed by releasing the memory used by the test before calling println.
Change-Id: Ibb40f14f08d5844145b1da65750ecb50a7330dcd
-rw-r--r-- | test/080-oom-throw/src/Main.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/080-oom-throw/src/Main.java b/test/080-oom-throw/src/Main.java index 3d75f3d9af..052feb664b 100644 --- a/test/080-oom-throw/src/Main.java +++ b/test/080-oom-throw/src/Main.java @@ -56,6 +56,8 @@ public class Main { int count = ArrayMemEater.blowup(holder, size); ArrayMemEater.confuseCompilerOptimization(holder); + // Ensure there is some reclaimable memory for println. + holder = null; if (count < size) { System.out.println("Array allocation failed"); } @@ -69,6 +71,8 @@ public class Main { lastMemEater = lastMemEater.next; } while (lastMemEater != null); memEater.confuseCompilerOptimization(memEater); + // Ensure there is some reclaimable memory for println. + memEater = null; System.out.println("Instance allocation failed"); } |