Loading core/java/com/android/internal/os/ZygoteConnection.java +2 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,8 @@ class ZygoteConnection { return handleAbiListQuery(); } ZygoteInit.maybePreload(); if (parsedArgs.preloadPackage != null) { return handlePreloadPackage(parsedArgs.preloadPackage, parsedArgs.preloadPackageLibs); Loading core/java/com/android/internal/os/ZygoteInit.java +25 −7 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ public class ZygoteInit { private static final int ROOT_UID = 0; private static final int ROOT_GID = 0; private static boolean sPreloadComplete; static void preload(BootTimingsTraceLog bootTimingsTraceLog) { Log.d(TAG, "begin preload"); bootTimingsTraceLog.traceBegin("BeginIcuCachePinning"); Loading @@ -134,6 +136,15 @@ public class ZygoteInit { endIcuCachePinning(); warmUpJcaProviders(); Log.d(TAG, "end preload"); sPreloadComplete = true; } public static void maybePreload() { if (!sPreloadComplete) { Log.i(TAG, "Lazily preloading resources."); preload(new BootTimingsTraceLog("ZygoteInitTiming_lazy", Trace.TRACE_TAG_DALVIK)); } } private static void beginIcuCachePinning() { Loading Loading @@ -660,9 +671,12 @@ public class ZygoteInit { boolean startSystemServer = false; String socketName = "zygote"; String abiList = null; boolean enableLazyPreload = false; for (int i = 1; i < argv.length; i++) { if ("start-system-server".equals(argv[i])) { startSystemServer = true; } else if ("--enable-lazy-preload".equals(argv[i])) { enableLazyPreload = true; } else if (argv[i].startsWith(ABI_LIST_ARG)) { abiList = argv[i].substring(ABI_LIST_ARG.length()); } else if (argv[i].startsWith(SOCKET_NAME_ARG)) { Loading @@ -677,6 +691,9 @@ public class ZygoteInit { } zygoteServer.registerServerSocket(socketName); // In some configurations, we avoid preloading resources and classes eagerly. // In such cases, we will preload things prior to our first fork. if (!enableLazyPreload) { bootTimingsTraceLog.traceBegin("ZygotePreload"); EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START, SystemClock.uptimeMillis()); Loading @@ -684,6 +701,7 @@ public class ZygoteInit { EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END, SystemClock.uptimeMillis()); bootTimingsTraceLog.traceEnd(); // ZygotePreload } // Finish profiling the zygote initialization. SamplingProfilerIntegration.writeZygoteSnapshot(); Loading Loading
core/java/com/android/internal/os/ZygoteConnection.java +2 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,8 @@ class ZygoteConnection { return handleAbiListQuery(); } ZygoteInit.maybePreload(); if (parsedArgs.preloadPackage != null) { return handlePreloadPackage(parsedArgs.preloadPackage, parsedArgs.preloadPackageLibs); Loading
core/java/com/android/internal/os/ZygoteInit.java +25 −7 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ public class ZygoteInit { private static final int ROOT_UID = 0; private static final int ROOT_GID = 0; private static boolean sPreloadComplete; static void preload(BootTimingsTraceLog bootTimingsTraceLog) { Log.d(TAG, "begin preload"); bootTimingsTraceLog.traceBegin("BeginIcuCachePinning"); Loading @@ -134,6 +136,15 @@ public class ZygoteInit { endIcuCachePinning(); warmUpJcaProviders(); Log.d(TAG, "end preload"); sPreloadComplete = true; } public static void maybePreload() { if (!sPreloadComplete) { Log.i(TAG, "Lazily preloading resources."); preload(new BootTimingsTraceLog("ZygoteInitTiming_lazy", Trace.TRACE_TAG_DALVIK)); } } private static void beginIcuCachePinning() { Loading Loading @@ -660,9 +671,12 @@ public class ZygoteInit { boolean startSystemServer = false; String socketName = "zygote"; String abiList = null; boolean enableLazyPreload = false; for (int i = 1; i < argv.length; i++) { if ("start-system-server".equals(argv[i])) { startSystemServer = true; } else if ("--enable-lazy-preload".equals(argv[i])) { enableLazyPreload = true; } else if (argv[i].startsWith(ABI_LIST_ARG)) { abiList = argv[i].substring(ABI_LIST_ARG.length()); } else if (argv[i].startsWith(SOCKET_NAME_ARG)) { Loading @@ -677,6 +691,9 @@ public class ZygoteInit { } zygoteServer.registerServerSocket(socketName); // In some configurations, we avoid preloading resources and classes eagerly. // In such cases, we will preload things prior to our first fork. if (!enableLazyPreload) { bootTimingsTraceLog.traceBegin("ZygotePreload"); EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START, SystemClock.uptimeMillis()); Loading @@ -684,6 +701,7 @@ public class ZygoteInit { EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END, SystemClock.uptimeMillis()); bootTimingsTraceLog.traceEnd(); // ZygotePreload } // Finish profiling the zygote initialization. SamplingProfilerIntegration.writeZygoteSnapshot(); Loading