summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2019-02-04 15:48:09 +0000
committer Mathieu Chartier <mathieuc@google.com> 2019-02-05 01:36:54 +0000
commit7b098c8487a05360de8f80fde48cfd28a3aa8321 (patch)
treecb570cae439cc7f3fcdbbd35f2514f0f42a17e76
parent20a2484e580ad3e312fe2fd84ce2a0662af78484 (diff)
Read "gctype" flag from namespace "runtime_native_boot".
ART does not support changing the garbage collector type/configuration dynamically at the moment, so we can only change it when the runtime starts, i.e. at boot time. Also materialize "gctype" and "runtime_native_boot" as named constants. Bug: 120794191 Bug: 72446017 Test: adb shell device_config put runtime_native_boot gctype nogenerational_cc && adb reboot Test: adb shell device_config put runtime_native_boot gctype generational_cc && adb reboot Change-Id: Ibf765a5f442136d6327be99786ea9ae4b4537d59
-rw-r--r--core/jni/AndroidRuntime.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 49598bbb5ada..d69d416e8401 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -230,6 +230,11 @@ extern int register_com_android_internal_os_Zygote(JNIEnv *env);
extern int register_com_android_internal_os_ZygoteInit(JNIEnv *env);
extern int register_com_android_internal_util_VirtualRefBasePtr(JNIEnv *env);
+// Namespace for Android Runtime flags applied during boot time.
+static const char* RUNTIME_NATIVE_BOOT_NAMESPACE = "runtime_native_boot";
+// Feature flag name for Garbage Collector type.
+static const char* GCTYPE = "gctype";
+
static AndroidRuntime* gCurRuntime = NULL;
/*
@@ -776,7 +781,9 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
}
std::string gc_type_override =
- server_configurable_flags::GetServerConfigurableFlag("runtime_native", "gctype", "");
+ server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE,
+ GCTYPE,
+ /*default_value=*/ "");
std::string gc_type_override_temp;
if (gc_type_override.empty()) {
parseRuntimeOption("dalvik.vm.gctype", gctypeOptsBuf, "-Xgc:");