summaryrefslogtreecommitdiffstats
path: root/core/jni/AndroidRuntime.cpp
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-08-18 19:15:36 -0700
committerDianne Hackborn <hackbod@google.com>2009-08-19 10:49:18 -0700
commitbdcef70e15e86e592d725355c96c7fab0b85ac83 (patch)
treea126782c6c137a5befac9e54ef057ab5ed50e47f /core/jni/AndroidRuntime.cpp
parent068c5db5c375804f23e711cc022156bf6f230a56 (diff)
downloadframeworks_base-bdcef70e15e86e592d725355c96c7fab0b85ac83.zip
frameworks_base-bdcef70e15e86e592d725355c96c7fab0b85ac83.tar.gz
frameworks_base-bdcef70e15e86e592d725355c96c7fab0b85ac83.tar.bz2
Fix issue #2010965: Increase process size on WVGA devices
This introduces a new system property to set the max vm size. The default is still 16mb.
Diffstat (limited to 'core/jni/AndroidRuntime.cpp')
-rw-r--r--core/jni/AndroidRuntime.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 2e73372..f61e247 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -525,6 +525,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
char dexoptFlagsBuf[PROPERTY_VALUE_MAX];
char enableAssertBuf[sizeof("-ea:")-1 + PROPERTY_VALUE_MAX];
char jniOptsBuf[sizeof("-Xjniopts:")-1 + PROPERTY_VALUE_MAX];
+ char heapsizeOptsBuf[sizeof("-Xmx")-1 + PROPERTY_VALUE_MAX];
char* stackTraceFile = NULL;
bool checkJni = false;
bool checkDexSum = false;
@@ -597,16 +598,10 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
mOptions.add(opt);
//options[curOpt++].optionString = "-verbose:class";
-#ifdef CUSTOM_RUNTIME_HEAP_MAX
-#define __make_max_heap_opt(val) #val
-#define _make_max_heap_opt(val) "-Xmx" __make_max_heap_opt(val)
- opt.optionString = _make_max_heap_opt(CUSTOM_RUNTIME_HEAP_MAX);
-#undef __make_max_heap_opt
-#undef _make_max_heap_opt
-#else
- /* limit memory use to 16MB */
- opt.optionString = "-Xmx16m";
-#endif
+ strcpy(heapsizeOptsBuf, "-Xmx");
+ property_get("dalvik.vm.heapsize", heapsizeOptsBuf+4, "16m");
+ //LOGI("Heap size: %s", heapsizeOptsBuf);
+ opt.optionString = heapsizeOptsBuf;
mOptions.add(opt);
/*