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

Issue 746472 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Not on Chrome anymore
Closed: Jan 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature



Sign in to add a comment

Drop ToolbarViewResourceAdapter bitmap under memory pressure

Project Member Reported by bauerb@chromium.org, Jul 19 2017

Issue description

ViewResourceAdapters (in particular the ToolbarViewResourceAdapter) keep a cache of the rendered view but are already able to deal with outdated bitmaps anyway, so we could drop that bitmap at some point, for example under memory pressure.

I've got a small prototype that seems to do the job.
 
Cc: tedc...@chromium.org
+tedchoc@ to keep me honest here.

I think the toolbar is special in that it is our core UI and is shown frequently. The ToolbarViewResourceAdapter is used to draw the C++ compositor version of the toolbar and is needed frequently (e.g. when the toolbar scrolls on or offscreen).
Indeed.  We should just see what happens in the case where we drop it.  If we could force simulate memory pressure easily, it would be cool to get a video of it dropping while scrolling off or just before we start the scroll.

It is definitely one of the last things I think we should drop, but if it prevents the page from being killed, having the omnibox flicker one frame seems like an OK compromise.
We can simulate memory pressure via adb:
adb shell am send-trim-memory com.android.chrome RUNNING_CRITICAL

Comment 4 by bauerb@chromium.org, Jul 20 2017

Status: Started (was: Assigned)
I tested with my prototype a bit and didn't see any jank when scrolling on the page or side-swiping. I've uploaded the CL at https://chromium-review.googlesource.com/c/577869/ if anyone wants to take a look.
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 16 2017

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

commit a1c8ef36d3468f1369efb2bbc81ec39018edba31
Author: Bernhard Bauer <bauerb@chromium.org>
Date: Mon Oct 16 19:12:24 2017

Drop ToolbarViewResourceAdapter bitmap under memory pressure.

To force a memory pressure signal for testing, run this command:
$ adb shell am send-trim-memory <package> RUNNING_CRITICAL

Bug:  746472 
Change-Id: Ib3d74f7de537ae8ae0f2c04f4228e53a9747349b
Reviewed-on: https://chromium-review.googlesource.com/577869
Commit-Queue: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509129}
[modify] https://crrev.com/a1c8ef36d3468f1369efb2bbc81ec39018edba31/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
[modify] https://crrev.com/a1c8ef36d3468f1369efb2bbc81ec39018edba31/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java

Comment 6 by bauerb@chromium.org, Jan 22 2018

Status: Fixed (was: Started)

Sign in to add a comment