From 1038dcdf2ce2340d8ebdf12e17456f7ef3eba7a6 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Thu, 30 Jan 2020 18:52:19 -0800 Subject: [PATCH] Pass down more profile saver options to the runtime Add the delay to save the resolved classes as a system property and pass it down to the runtime Test: build and check profile saver activity Bug: 141487932 Change-Id: I17278505e29295d3ecfe1e1e782da11f5356ebfd --- core/jni/AndroidRuntime.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 551541e4329a8..cbba5bbee01ca 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -664,6 +664,8 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p char jitprithreadweightOptBuf[sizeof("-Xjitprithreadweight:")-1 + PROPERTY_VALUE_MAX]; char jittransitionweightOptBuf[sizeof("-Xjittransitionweight:")-1 + PROPERTY_VALUE_MAX]; char hotstartupsamplesOptsBuf[sizeof("-Xps-hot-startup-method-samples:")-1 + PROPERTY_VALUE_MAX]; + char saveResolvedClassesDelayMsOptsBuf[ + sizeof("-Xps-save-resolved-classes-delay-ms:")-1 + PROPERTY_VALUE_MAX]; char madviseRandomOptsBuf[sizeof("-XX:MadviseRandomAccess:")-1 + PROPERTY_VALUE_MAX]; char gctypeOptsBuf[sizeof("-Xgc:")-1 + PROPERTY_VALUE_MAX]; char backgroundgcOptsBuf[sizeof("-XX:BackgroundGC=")-1 + PROPERTY_VALUE_MAX]; @@ -859,6 +861,9 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool p parseRuntimeOption("dalvik.vm.hot-startup-method-samples", hotstartupsamplesOptsBuf, "-Xps-hot-startup-method-samples:"); + parseRuntimeOption("dalvik.vm.ps-resolved-classes-delay-ms", saveResolvedClassesDelayMsOptsBuf, + "-Xps-save-resolved-classes-delay-ms:"); + property_get("ro.config.low_ram", propBuf, ""); if (strcmp(propBuf, "true") == 0) { addOption("-XX:LowMemoryMode");