Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 738fa2f6 authored by Mathieu Chartier's avatar Mathieu Chartier Committed by Gerrit Code Review
Browse files

Merge "Add dalvik.vm.gctype to enable switching between different GCs."

parents b6634304 7e4fdec6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -448,6 +448,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
    char heapgrowthlimitOptsBuf[sizeof("-XX:HeapGrowthLimit=")-1 + PROPERTY_VALUE_MAX];
    char heapminfreeOptsBuf[sizeof("-XX:HeapMinFree=")-1 + PROPERTY_VALUE_MAX];
    char heapmaxfreeOptsBuf[sizeof("-XX:HeapMaxFree=")-1 + PROPERTY_VALUE_MAX];
    char gctypeOptsBuf[sizeof("-Xgc:")-1 + PROPERTY_VALUE_MAX];
    char heaptargetutilizationOptsBuf[sizeof("-XX:HeapTargetUtilization=")-1 + PROPERTY_VALUE_MAX];
    char jitcodecachesizeOptsBuf[sizeof("-Xjitcodecachesize:")-1 + PROPERTY_VALUE_MAX];
    char extraOptsBuf[PROPERTY_VALUE_MAX];
@@ -583,6 +584,13 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
      mOptions.add(opt);
    }

    strcpy(gctypeOptsBuf, "-Xgc:");
    property_get("dalvik.vm.gctype", gctypeOptsBuf+5, "");
    if (gctypeOptsBuf[5] != '\0') {
        opt.optionString = gctypeOptsBuf;
        mOptions.add(opt);
    }

    /*
     * Enable or disable dexopt features, such as bytecode verification and
     * calculation of register maps for precise GC.