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

Issue 631822 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

[WebView] Blink MemoryCache should have some way to react onTrimMemory() callback

Project Member Reported by morrita@google.com, Jul 26 2016

Issue description

Currently it discards image cache, but not memory cache. 
Memory cache should be discarded as well, regardless of the device memory profile.

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp?rcl=1469488599&l=39

- It matters for some apps that load images and release it once it is no longer used
  (Think infinite scroll image list with virtual viewport, for example.)
- If WebView doesn't throw away these cache, its memory usage stays high, and
  makes hosting app killed by system.
 
Cc: hirosh...@chromium.org csharrison@chromium.org
Cc: hajimehoshi@chromium.org

Comment 3 by kinuko@chromium.org, Jul 27 2016

Cc: -hajimehoshi@chromium.org bashi@chromium.org
Components: Blink>MemoryAllocator
Owner: hajimehoshi@chromium.org
Status: Assigned (was: Untriaged)
hajimehoshi@, bashi@: could this be triaged by memory team, or do we want to put off until the ongoing efforts around image resource / memory cache handling is done?
Project Member

Comment 4 by sheriffbot@chromium.org, Jul 27 2016

Labels: Hotlist-Google

Comment 5 by bashi@chromium.org, Jul 28 2016

I think we should handle this issue separately because existing efforts aren't for "what should we do when there is a memory pressure".

Memory coordinator[1] is supposed to be a right solution for this, but I don't think it will be available soon. Maybe we just want to remove isLowEndDevice() check, but we need to be careful to do that.

[1] https://docs.google.com/document/d/1dkUXXmpJk7xBUeQM-olBpTHJ2MXamDgY_kjNrl9JXMs/edit

Comment 6 by bashi@chromium.org, Jul 28 2016

morrita@,

BTW, how much does MemoryCache contribute to memory consumption in your application? Is it one of the main memory consumers?
Cc: hajimehoshi@chromium.org
Owner: ----
Status: Untriaged (was: Assigned)

Comment 8 by boliu@chromium.org, Feb 24 2017

Cc: haraken@chromium.org
webview bug cop here.. this one seems important if this is still the case, as webview is single process and can't just kill a renderer to free memory, +haraken as a bump
Owner: tasak@google.com
tasak@: Would you take a look at this?

Comment 10 by tasak@google.com, Feb 24 2017

Status: Assigned (was: Untriaged)
Project Member

Comment 11 by bugdroid1@chromium.org, Mar 10 2017

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

commit 3c0495f5784b674f4ff0792da9a6d7c62815b565
Author: tasak <tasak@google.com>
Date: Fri Mar 10 04:17:11 2017

blink MemoryCoordinator::onPurgeMemory should invoke each client's onPurgeMemory.

BUG=631822,670539

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

[modify] https://crrev.com/3c0495f5784b674f4ff0792da9a6d7c62815b565/third_party/WebKit/Source/platform/MemoryCoordinator.cpp

Owner: tasak@chromium.org

Sign in to add a comment