diff options
| author | 2019-10-25 13:20:46 -0700 | |
|---|---|---|
| committer | 2019-10-25 13:20:46 -0700 | |
| commit | fca111db2fcdc93bf5acd17ce23bfde10570abe7 (patch) | |
| tree | 0816933067e356ce8662578311fe5afc345a7f92 | |
| parent | 0892a932dffc9c55c7bdf7df5cf243003144ccb1 (diff) | |
| parent | ac60bbb7408b2babf7448d3964e9ed3e1d46bf83 (diff) | |
Merge "Avoid preloading classes for boot image profiling" am: cfee28589b am: 84f358f9bf
am: ac60bbb740
Change-Id: I48fa3fbc8b9f2859a084bf36d06117a1ea8970cf
| -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 + "."); |