Fix heap exhaustion logic
To ensure that heap exhaustion loop is not a nop in subsequent
iterations.
Bug: 144525957
Test: art/test/testrunner/testrunner.py
Change-Id: I08cbc69846b59ca4ba91f89c56b5f90de8b61408
diff --git a/test/044-proxy/src/OOMEOnDispatch.java b/test/044-proxy/src/OOMEOnDispatch.java
index 0f58bc4..75574e7 100644
--- a/test/044-proxy/src/OOMEOnDispatch.java
+++ b/test/044-proxy/src/OOMEOnDispatch.java
@@ -27,7 +27,7 @@
static ArrayList<Object> storage = new ArrayList<>(100000);
private static void exhaustJavaHeap(int size) {
- while (size > 8) {
+ while (size > 0) {
try {
storage.add(new byte[size]);
} catch (OutOfMemoryError e) {
diff --git a/test/064-field-access/src/OOMEOnNullAccess.java b/test/064-field-access/src/OOMEOnNullAccess.java
index b464170..e854b1b 100644
--- a/test/064-field-access/src/OOMEOnNullAccess.java
+++ b/test/064-field-access/src/OOMEOnNullAccess.java
@@ -37,7 +37,7 @@
static ArrayList<Object> storage = new ArrayList<>(100000);
private static void exhaustJavaHeap(int size) {
- while (size > 8) {
+ while (size > 0) {
try {
storage.add(new byte[size]);
} catch (OutOfMemoryError e) {