OSDN Git Service

Launch VM with -XX:LowMemoryMode if ro.config.low_ram is "true".
authorMathieu Chartier <mathieuc@google.com>
Wed, 21 Aug 2013 00:16:03 +0000 (17:16 -0700)
committerThe Android Automerger <android-build@google.com>
Wed, 21 Aug 2013 22:10:37 +0000 (15:10 -0700)
Bug: 10131789

Change-Id: Ib9962f7becdedd71f48123a4720dcce1d09abb9d

core/jni/AndroidRuntime.cpp

index 8472705..9c323ba 100644 (file)
@@ -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.