summaryrefslogtreecommitdiffstats
path: root/test/061-out-of-memory
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2012-01-23 15:43:46 -0800
committerIan Rogers <irogers@google.com>2012-01-26 17:32:10 -0800
commit30fab40ee5a07af6b8c3b6b0e9438071695a57f4 (patch)
tree86514e3535c8b23cf52249a202076b59ac532021 /test/061-out-of-memory
parentf3778f66879fa038a7c9ebe46d5bc4167ddef7d8 (diff)
downloadandroid_art-30fab40ee5a07af6b8c3b6b0e9438071695a57f4.tar.gz
android_art-30fab40ee5a07af6b8c3b6b0e9438071695a57f4.tar.bz2
android_art-30fab40ee5a07af6b8c3b6b0e9438071695a57f4.zip
Upgrade to latest dlmalloc. Refactor Heap and related APIs to use STL like naming.
We fail assertions in the existing heap code, as does Dalvik. This refactoring is to clean the heap and space APIs and to reduce duplication of data and thereby solve a failing assertion in the card table. This change also wires up clearing of soft references including before out-of-memory errors are reported. In doing this change it was made clear that mspaces are buggy (and violating invariants with the garbage collector). This change upgrades to an un-Android molested version of dlmalloc-2.8.5 and implements a version of the mspace morecore routine under ART control. run-test 061-out-of-memory is updated for current heap sizes. Change-Id: I377e83ab2a8c78afb9b1881f03356929e2c9dc64
Diffstat (limited to 'test/061-out-of-memory')
-rw-r--r--test/061-out-of-memory/src/Main.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/061-out-of-memory/src/Main.java b/test/061-out-of-memory/src/Main.java
index b5999b34b3..c04d41f3fa 100644
--- a/test/061-out-of-memory/src/Main.java
+++ b/test/061-out-of-memory/src/Main.java
@@ -46,15 +46,15 @@ public class Main {
/* Just shy of the typical max heap size so that it will actually
* try to allocate it instead of short-circuiting.
*
- * TODO: stop assuming the VM defaults to 16MB max
+ * TODO: stop assuming the VM defaults to 64MB max
*/
- final int SIXTEEN_MB = (16 * 1024 * 1024 - 32);
+ final int SIXTY_FOUR_MB = (64 * 1024 * 1024 - 32);
Boolean sawEx = false;
byte a[];
try {
- a = new byte[SIXTEEN_MB];
+ a = new byte[SIXTY_FOUR_MB];
} catch (OutOfMemoryError oom) {
//Log.i(TAG, "HeapTest/OomeLarge caught " + oom);
sawEx = true;
@@ -72,10 +72,10 @@ public class Main {
* list afterwards. Even if we null out list when we're done, the conservative
* GC may see a stale pointer to it in a register.
*
- * TODO: stop assuming the VM defaults to 16MB max
+ * TODO: stop assuming the VM defaults to 64MB max
*/
private static boolean testOomeSmallInternal() {
- final int SIXTEEN_MB = (16 * 1024 * 1024);
+ final int SIXTY_FOUR_MB = (64 * 1024 * 1024);
final int LINK_SIZE = 6 * 4; // estimated size of a LinkedList's node
LinkedList<Object> list = new LinkedList<Object>();
@@ -86,7 +86,7 @@ public class Main {
while (objSize >= LINK_SIZE) {
boolean sawEx = false;
try {
- for (int i = 0; i < SIXTEEN_MB / objSize; i++) {
+ for (int i = 0; i < SIXTY_FOUR_MB / objSize; i++) {
list.add((Object)new byte[objSize]);
}
} catch (OutOfMemoryError oom) {