@@ -453,6 +453,9 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
453453 char heapstartsizeOptsBuf[sizeof (" -Xms" )-1 + PROPERTY_VALUE_MAX];
454454 char heapsizeOptsBuf[sizeof (" -Xmx" )-1 + PROPERTY_VALUE_MAX];
455455 char heapgrowthlimitOptsBuf[sizeof (" -XX:HeapGrowthLimit=" )-1 + PROPERTY_VALUE_MAX];
456+ char heapminfreeOptsBuf[sizeof (" -XX:HeapMinFree=" )-1 + PROPERTY_VALUE_MAX];
457+ char heapmaxfreeOptsBuf[sizeof (" -XX:HeapMaxFree=" )-1 + PROPERTY_VALUE_MAX];
458+ char heaptargetutilizationOptsBuf[sizeof (" -XX:HeapTargetUtilization=" )-1 + PROPERTY_VALUE_MAX];
456459 char extraOptsBuf[PROPERTY_VALUE_MAX];
457460 char * stackTraceFile = NULL ;
458461 bool checkJni = false ;
@@ -555,6 +558,27 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
555558 mOptions .add (opt);
556559 }
557560
561+ strcpy (heapminfreeOptsBuf, " -XX:HeapMinFree=" );
562+ property_get (" dalvik.vm.heapminfree" , heapminfreeOptsBuf+16 , " " );
563+ if (heapminfreeOptsBuf[16 ] != ' \0 ' ) {
564+ opt.optionString = heapminfreeOptsBuf;
565+ mOptions .add (opt);
566+ }
567+
568+ strcpy (heapmaxfreeOptsBuf, " -XX:HeapMaxFree=" );
569+ property_get (" dalvik.vm.heapmaxfree" , heapmaxfreeOptsBuf+16 , " " );
570+ if (heapmaxfreeOptsBuf[16 ] != ' \0 ' ) {
571+ opt.optionString = heapmaxfreeOptsBuf;
572+ mOptions .add (opt);
573+ }
574+
575+ strcpy (heaptargetutilizationOptsBuf, " -XX:HeapTargetUtilization=" );
576+ property_get (" dalvik.vm.heaptargetutilization" , heaptargetutilizationOptsBuf+26 , " " );
577+ if (heapmaxfreeOptsBuf[26 ] != ' \0 ' ) {
578+ opt.optionString = heaptargetutilizationOptsBuf;
579+ mOptions .add (opt);
580+ }
581+
558582 /*
559583 * Enable or disable dexopt features, such as bytecode verification and
560584 * calculation of register maps for precise GC.
0 commit comments