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

Commit d2a975ad authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Add gctype device config property for GC experiments

Added to the runtime_native namespace.

The new property overrides dalvik.vm.gctype if it's set.

Bug: 120794191
Test: adb shell device_config put runtime_native gctype CC,preverify
Test: adb reboot

Change-Id: I30a2a3bcfb83f502f168c0d8588d80982a5f7d76
parent 1444690e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -301,6 +301,7 @@ cc_library_shared {
        "libhwui",
        "libdl",
        "libstatslog",
        "server_configurable_flags",
    ],

    generated_sources: ["android_util_StatsLog.cpp"],
+12 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <binder/Parcel.h>
#include <utils/threads.h>
#include <cutils/properties.h>
#include <server_configurable_flags/get_flags.h>

#include <SkGraphics.h>

@@ -774,7 +775,17 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
      addOption("-XX:LowMemoryMode");
    }

    std::string gc_type_override =
            server_configurable_flags::GetServerConfigurableFlag("runtime_native", "gctype", "");
    std::string gc_type_override_temp;
    if (gc_type_override.empty()) {
        parseRuntimeOption("dalvik.vm.gctype", gctypeOptsBuf, "-Xgc:");
    } else {
        // Copy the string so it doesn't go out of scope since addOption does not make a copy.
        gc_type_override_temp = "-Xgc:" + gc_type_override;
        addOption(gc_type_override_temp.c_str());
    }

    parseRuntimeOption("dalvik.vm.backgroundgctype", backgroundgcOptsBuf, "-XX:BackgroundGC=");

    /*