New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 848328 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Increase number of sandboxed service slots to 40

Project Member Reported by boliu@chromium.org, May 31 2018

Issue description

Site isolation makes it much more likely to run into intentional kills because it launches more renderers and keeps the renderers in higher importance.

Data shows there's a non-trivial amount of killing *visible* subframes, which means a single page alone can hit the slot limit. Killing invisible renderers is also up significantly.

Google-only doc with data: https://docs.google.com/document/d/1YolLnahAxozzLgWLhTsO2R2Iq98X-VAj2xZ2rvCEVJE/edit?usp=sharing

Double it to 40 for now and monitor impact
 

Comment 1 by boliu@chromium.org, May 31 2018

Cc: agrieve@chromium.org
+agrieve for gn help.

There's already 20 copies of SandboxedProcessService<N>.java files. Making that 40 doesn't feel very appealing

Probably should use a jinja template for this? But I didn't find any way in gn to repeat an action 40 times make that easy to depend on. So I guess this needs a python script instead, which has the up side of zipping the source files too. Any advice here?
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 1 2018

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

commit b84d1dc5f2500d8aa274807efbf12e4fe3930c4c
Author: Bo Liu <boliu@chromium.org>
Date: Fri Jun 01 20:55:57 2018

android: Generate SandboxedProcessServiceX.java

Use a jinja template instead of keeping the actual duplicate files in
the source. Still have to list all indices in gn file, but that's still
much better.

Bug: 848328
Change-Id: Ia6fc3f1b214af81c061e2086f181a8984842170e
Reviewed-on: https://chromium-review.googlesource.com/1081474
Commit-Queue: Bo <boliu@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563791}
[modify] https://crrev.com/b84d1dc5f2500d8aa274807efbf12e4fe3930c4c/content/public/android/BUILD.gn
[add] https://crrev.com/b84d1dc5f2500d8aa274807efbf12e4fe3930c4c/content/public/android/generate_child_service.py
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService0.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService1.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService10.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService11.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService12.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService13.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService14.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService15.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService16.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService17.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService18.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService19.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService2.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService3.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService4.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService5.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService6.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService7.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService8.java
[delete] https://crrev.com/1636332a095f00b78684b004e68028737e61de44/content/public/android/java/src/org/chromium/content/app/SandboxedProcessService9.java

Project Member

Comment 3 by bugdroid1@chromium.org, Jun 1 2018

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

commit de93fe0f9ed2e7df500836aa70c55f31efb27efd
Author: Bo Liu <boliu@chromium.org>
Date: Fri Jun 01 23:24:41 2018

android: Double sandboxed service to 40

Bug: 848328
Merge-With: eureka-internal/175153
Change-Id: I97bb62c0db4d5812546b88eb3947fabea725e60d
Reviewed-on: https://chromium-review.googlesource.com/1083600
Commit-Queue: Bo <boliu@chromium.org>
Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Simeon Anfinrud <sanfin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563857}
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/android_webview/apk/java/AndroidManifest.xml
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/chrome/android/java/AndroidManifest.xml
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/chromecast/browser/android/apk/AndroidManifest.xml.jinja2
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/components/test/android/browsertests_apk/AndroidManifest.xml.jinja2
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/content/public/android/BUILD.gn
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/content/shell/android/browsertests_apk/AndroidManifest.xml.jinja2
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/content/shell/android/linker_test_apk/AndroidManifest.xml.jinja2
[modify] https://crrev.com/de93fe0f9ed2e7df500836aa70c55f31efb27efd/content/shell/android/shell_apk/AndroidManifest.xml.jinja2

Cc: klo...@chromium.org
I am fine with doubling the number of the services.

But I am wondering whether we did hit the limit in a single page. One thing I can imagine is we have two pages both visible during the transition. Should we get some confirmation on the status when we have to hit the visible iframe process?

Comment 5 by boliu@chromium.org, Jun 5 2018

That's definitely a possibility.

There are other possibilities too:
multi-window
tab playing music is still considered visible, which we should consider changing for oopif

Comment 6 by boliu@chromium.org, Jun 13 2018

I was thinking a bit of how to confirm this. Counting edge case like if a kill is from a navigation is a bit hard. Because that navigation could have been in somewhere totally unrelated.

I think it's much more useful to log a histogram for the maximum number of processes a tab used. I don't think such a histogram exists? Anyone know?

There's a bunch of SiteIsolation.* histograms, but those are sampled over time, not the max; and they appear to all be global, not per tab. Some of them do look interesting though, like SiteIsolation.CurrentRendererProcessCount almost doubling at 95 percentile.

Comment 7 by nasko@chromium.org, Jun 14 2018

How do you want to tell? In tests or while using the browser? If the former, one can iterate over all RenderProcessHosts and count them. If the latter, I just added a chrome://process-internals (issue 850087) exactly with that in mind - to expose details about processes in a more accessible way on Android and not needing adb to check things. One of the next CLs will expose the number of running renderer processes, so we can see that at a glance.

Comment 8 by boliu@chromium.org, Jun 14 2018

> How do you want to tell? In tests or while using the browser?

In a histogram, from production.

I think I'll have to write one, which is fine.
I think the closest histogram we've got to that is SiteIsolation.SiteInstancesPerBrowsingInstance.  That uses the BrowsingInstance instead of tab, which means it will also include scriptable windows opened with window.open(), as well as SiteInstances staying in session history after navigations, so it'll overcount what you want, but it's a reasonable start.  When in --site-per-process mode, two SiteInstances (for different sites) should always use different processes.

If you wanted to add a new UMA to measure this precisely, you could start with this code and simply collect processes instead of SiteInstances: https://cs.chromium.org/chromium/src/content/browser/frame_host/frame_tree.cc?l=40&rcl=9311dc3820b9be71b3a86877e016bb5efae26edd

Cc: alex...@chromium.org

Comment 11 by boliu@chromium.org, Jun 14 2018

Ahh, SiteInstancesPerBrowsingInstance does come close. Alas that's also sampled over time. In this case, I'm more interested in the distribution of maximum number of processes per tab. Trying to get an estimate how frequently android runs out of renderer slots just from a single tab/page.

Sign in to add a comment