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

Commit c0f18b9d authored by Mathieu Chartier's avatar Mathieu Chartier Committed by Android Git Automerger
Browse files

am c4c77d63: Merge "Add property for background GC type"

* commit 'c4c77d63':
  Add property for background GC type
parents d05c7d26 c4c77d63
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -467,6 +467,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
    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 backgroundgcOptsBuf[sizeof("-XX:BackgroundGC=")-1 + PROPERTY_VALUE_MAX];
    char heaptargetutilizationOptsBuf[sizeof("-XX:HeapTargetUtilization=")-1 + PROPERTY_VALUE_MAX];
    char jitcodecachesizeOptsBuf[sizeof("-Xjitcodecachesize:")-1 + PROPERTY_VALUE_MAX];
    char dalvikVmLibBuf[PROPERTY_VALUE_MAX];
@@ -620,6 +621,13 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
        mOptions.add(opt);
    }

    strcpy(backgroundgcOptsBuf, "-XX:BackgroundGC=");
    property_get("dalvik.vm.backgroundgctype", backgroundgcOptsBuf+sizeof("-XX:BackgroundGC=")-1, "");
    if (backgroundgcOptsBuf[sizeof("-XX:BackgroundGC=")-1] != '\0') {
        opt.optionString = backgroundgcOptsBuf;
        mOptions.add(opt);
    }

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