diff options
author | 2019-10-25 19:35:00 +0000 | |
---|---|---|
committer | 2019-10-25 19:35:00 +0000 | |
commit | cfee28589ba3f23d34fa1b5836bc358097f558c1 (patch) | |
tree | ca595bd00dbe1564355ca4ed81288eac041930c0 | |
parent | 17518fa149ed8fdf7ba06bc905a752ac3d702922 (diff) | |
parent | d3c72db3bb210939ca9ff814577e00111baf4018 (diff) |
Merge "Avoid preloading classes for boot image profiling"
-rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 72d24645a2e7..ad4c6dd7a92b 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -248,6 +248,18 @@ public class ZygoteInit { InputStream is; try { + // If we are profiling the boot image, avoid preloading classes. + // Can't use device_config since we are the zygote. + String prop = SystemProperties.get( + "persist.device_config.runtime_native_boot.profilebootclasspath", ""); + // Might be empty if the property is unset since the default is "". + if (prop.length() == 0) { + prop = SystemProperties.get("dalvik.vm.profilebootclasspath", ""); + } + if ("true".equals(prop)) { + return; + } + is = new FileInputStream(PRELOADED_CLASSES); } catch (FileNotFoundException e) { Log.e(TAG, "Couldn't find " + PRELOADED_CLASSES + "."); |