summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/Android.common.mk1
-rw-r--r--build/Android.oattest.mk2
-rw-r--r--test/MemUsage/MemUsage.java19
3 files changed, 22 insertions, 0 deletions
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 5903eae..c200a0c 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -212,6 +212,7 @@ TEST_DEX_DIRECTORIES := \
IntMath \
Interfaces \
Main \
+ MemUsage \
MyClass \
MyClassNatives \
Nested \
diff --git a/build/Android.oattest.mk b/build/Android.oattest.mk
index 48371a8..ad52064 100644
--- a/build/Android.oattest.mk
+++ b/build/Android.oattest.mk
@@ -81,4 +81,6 @@ $(eval $(call declare-test-test-target,SystemMethods,))
# $(eval $(call declare-test-test-target,StackWalk,))
# $(eval $(call declare-test-test-target,StackWalk2,))
+$(eval $(call declare-test-test-target,MemUsage,))
+
########################################################################
diff --git a/test/MemUsage/MemUsage.java b/test/MemUsage/MemUsage.java
new file mode 100644
index 0000000..4cc4159
--- /dev/null
+++ b/test/MemUsage/MemUsage.java
@@ -0,0 +1,19 @@
+
+
+public class MemUsage {
+ public static final int NUM_1D_ARRAYS = 1000;
+ public static final int INCREMENT = 300;
+
+ public static void main(String [] args) {
+ int sz = 1000;
+ double[][] RelocationArray = new double[NUM_1D_ARRAYS][];
+ while (true) {
+ for (int i = 0; i < NUM_1D_ARRAYS; i++) {
+ RelocationArray[i] = new double[sz];
+ if (sz + INCREMENT > 0) {
+ sz += INCREMENT;
+ }
+ }
+ }
+ }
+}