New issue
Advanced search Search tips

Issue 607560 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Investigate why a new child process is created in Custom Tabs, even when the spare renderer is used.

Project Member Reported by lizeb@chromium.org, Apr 28 2016

Issue description

See this log, following a "connect -> warmup -> launch" sequence:

I/ActivityManager( 6305): Start proc 31391:com.google.android.apps.chrome:sandboxed_process0/u0i302 for service com.google.android.apps.chrome/org.chromium.content.app.SandboxedProcessService0
I/cr_ChildProcessService(31391): Creating new ChildProcessService pid=31391
I/cr_LibraryLoader(31391): Using linker: org.chromium.base.library_loader.LegacyLinker
I/cr_LibraryLoader(31369): Time to load native libraries: 142 ms (timestamps 5047-5189)
I/cr_LibraryLoader(31369): Expected native library version number "52.0.2720.0", actual native library version number "52.0.2720.0"
I/chromium(31369): [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
E/libEGL  (31369): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
I/Adreno-EGL(31369): <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 01/14/15, ab0075f, Id3510ff6dc
I/cr_LibraryLoader(31391): Loading chrome
I/cr_LibraryLoader(31391): Time to load native libraries: 95 ms (timestamps 5199-5294)
I/cr_LibraryLoader(31391): Expected native library version number "52.0.2720.0", actual native library version number "52.0.2720.0"
I/chromium(31391): [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0


I/ActivityManager( 6305): START u0 {act=android.intent.action.VIEW dat=https://www.google.com pkg=com.google.android.apps.chrome cmp=com.google.android.apps.chrome/.Main (has extras)} from uid 10306 on display 0
I/ActivityManager( 6305): START u0 {act=android.intent.action.VIEW dat=https://www.google.com pkg=com.google.android.apps.chrome cmp=com.google.android.apps.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity (has extras)} from uid 10287 on display 0
I/ActivityManager( 6305): Start proc 31632:com.google.android.apps.chrome:sandboxed_process1/u0i303 for service com.google.android.apps.chrome/org.chromium.content.app.SandboxedProcessService1
I/cr_ChildProcessService(31632): Creating new ChildProcessService pid=31632
V/WindowManager( 6305): Adding window Window{135957bd u0 SurfaceView} at 5 of 12 (before Window{25379926 u0 com.google.android.apps.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity})
I/ActivityManager( 6305): Displayed com.google.android.apps.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity: +265ms (total +299ms)


- 31191 is the spare renderer, loading the native lib.
- The intent comes in, is routed through the launcher Activity.
- Another child process (31632) is launched, but *never* loads the native library. It is not used for the navigation.

This is not a huge problem, as the extra child process is idle, and the proper process is used for the navigation. However, this is still something to fix.
 

Comment 1 by lizeb@chromium.org, Jun 21 2016

This is due to AsyncInitializationActivity calling NativeInitializationController#startBackgroundTasks() from setContentViewAndLoadLibrary(). It calls ChildProcessLauncher#warmUp(), which creates a new child connection.

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e9391e898bef5109a3b41bb2cf79548c62668e4e

commit e9391e898bef5109a3b41bb2cf79548c62668e4e
Author: lizeb <lizeb@chromium.org>
Date: Thu Jun 23 15:20:26 2016

customtabs: Don't create an extra child process when one is already there.

When a CustomTabActivity is created, the normal initialization sequence
in AsyncInitializationActivity allocates a new child connection. This
asks Android to start a new isolated process. When a spare renderer or a
prerender is used, this is useless and wasteful. Even though this mostly
does not happen on the main thread, child process binding usually takes
>150ms on Android.
Removing this overhead saves memory (a few MB of PSS) and CPU time, and
should speed up Custom Tabs startup, especially on low-end devices.

BUG= 607560 

Review-Url: https://codereview.chromium.org/2087043003
Cr-Commit-Position: refs/heads/master@{#401609}

[modify] https://crrev.com/e9391e898bef5109a3b41bb2cf79548c62668e4e/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
[modify] https://crrev.com/e9391e898bef5109a3b41bb2cf79548c62668e4e/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java
[modify] https://crrev.com/e9391e898bef5109a3b41bb2cf79548c62668e4e/chrome/android/java/src/org/chromium/chrome/browser/init/NativeInitializationController.java
[modify] https://crrev.com/e9391e898bef5109a3b41bb2cf79548c62668e4e/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java

Comment 3 by lizeb@chromium.org, Jun 23 2016

Status: Fixed (was: Assigned)

Sign in to add a comment