summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-08-20 17:16:03 -0700
committerMathieu Chartier <mathieuc@google.com>2013-08-20 17:38:24 -0700
commite6c2241f7a1e6bca3fd8d5d0c49abbbd348366b7 (patch)
tree48580cb61259b637a207d0a7f347093d4228f171
parent59bbba7c37f2ce7b7fd00aef87b49d681b4a3a79 (diff)
downloadframeworks_base-e6c2241f7a1e6bca3fd8d5d0c49abbbd348366b7.zip
frameworks_base-e6c2241f7a1e6bca3fd8d5d0c49abbbd348366b7.tar.gz
frameworks_base-e6c2241f7a1e6bca3fd8d5d0c49abbbd348366b7.tar.bz2
Launch VM with -XX:LowMemoryMode if ro.config.low_ram is "true".
Bug: 10131789 Change-Id: Ib9962f7becdedd71f48123a4720dcce1d09abb9d
-rw-r--r--core/jni/AndroidRuntime.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 8472705..9c323ba 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -589,6 +589,12 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
mOptions.add(opt);
}
+ property_get("ro.config.low_ram", propBuf, "");
+ if (strcmp(propBuf, "true") == 0) {
+ opt.optionString = "-XX:LowMemoryMode";
+ mOptions.add(opt);
+ }
+
/*
* Enable or disable dexopt features, such as bytecode verification and
* calculation of register maps for precise GC.