am 28a9230f: am 9ff57d53: Size the leak test allocation base on memory class.
* commit '28a9230f5c5f2e02373c7bab74aeeb011f717639':
Size the leak test allocation base on memory class.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java b/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java
index ce9153b..b8c133a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java
@@ -16,10 +16,12 @@
package android.renderscript.cts;
+import android.app.ActivityManager;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.Type;
import android.util.Log;
+import android.content.Context;
/*
// -target-api 11
@@ -44,10 +46,16 @@
* bug, since it may have been compiled without .rs.dtor() support.
*/
public class LeakTest extends RSBaseCompute {
- private final static int x = 16 * 1024 * 1024;
private static final String TAG = "LeakTest";
public void testForLeaks() {
+ ActivityManager am = (ActivityManager) getContext().getSystemService("activity");
+ int mc = am.getLargeMemoryClass() / 32;
+ if (mc < 1) {
+ mc = 1;
+ }
+ int x = mc * 1024 * 1024;
+
for (int i = 0; i < 100; i++) {
Log.w(TAG, "Leak test iteration " + i);
ScriptC_leak leak = new ScriptC_leak(mRS);