summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-02-02 17:44:31 -0800
committerAndreas Gampe <agampe@google.com>2015-02-02 17:44:31 -0800
commit2f6046edd7da9bb67e30b377955ff6faa8bff67e (patch)
treee9adb87a30c5b0a3cf7cebf8e1a70388e5eace4c
parent7687b250a565f465e3222c8b5adda1427f10c5f6 (diff)
downloadart-2f6046edd7da9bb67e30b377955ff6faa8bff67e.zip
art-2f6046edd7da9bb67e30b377955ff6faa8bff67e.tar.gz
art-2f6046edd7da9bb67e30b377955ff6faa8bff67e.tar.bz2
ART: Make 074-gc-thrash more OOME tolerant
The strong and weak array need to stay in sync. Don't set the strong reference when the weak reference can't be allocated. Change-Id: I6c8f245627d206d89a378099cea97e4f1cd1d9fa
-rw-r--r--test/074-gc-thrash/src/Main.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/074-gc-thrash/src/Main.java b/test/074-gc-thrash/src/Main.java
index 32fbf2d..238e73a 100644
--- a/test/074-gc-thrash/src/Main.java
+++ b/test/074-gc-thrash/src/Main.java
@@ -292,8 +292,8 @@ class Deep extends Thread {
break;
}
- strong[depth] = funStr;
weak[depth] = new WeakReference(funStr);
+ strong[depth] = funStr;
if (depth+1 < MAX_DEPTH)
dive(depth+1, iteration+1);
else