Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Issue 1016493002: Add a DiscardableMemoryShmemeAllocator. (Closed)

Created:
5 years, 9 months ago by Elliot Glaysher
Modified:
5 years, 9 months ago
Reviewers:
jamesr, sky
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a DiscardableMemoryAllocator to html_viewer. Recent changes to skia now require this object, and crash if this factory isn't supplied. We create the minimal implementation to get a Google search working in html_viewer. This allocator will free unlocked chunks once it has reached its memory threshold. We're starting with a soft limit of 20 megabytes. We'll adjust this based on observed performance. Committed: https://crrev.com/5f32298dbf36a4c48ef02d18b6acb1f2be759195 Cr-Commit-Position: refs/heads/master@{#321461}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Build a simple allocator. #

Patch Set 3 : Better comment. #

Patch Set 4 : Add unit tests #

Total comments: 6

Patch Set 5 : Rebase to ToT and hit jamesr's comments. #

Patch Set 6 : And fix the unittests #

Total comments: 10

Patch Set 7 : more jamesr comments #

Patch Set 8 : Only keep track of unlocked chunks. #

Total comments: 4

Patch Set 9 : jamesr comments + rebase to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -1 line) Patch
M mojo/services/html_viewer/BUILD.gn View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
A mojo/services/html_viewer/discardable_memory_allocator.h View 1 2 3 4 5 6 7 1 chunk +61 lines, -0 lines 0 comments Download
A mojo/services/html_viewer/discardable_memory_allocator.cc View 1 2 3 4 5 6 7 8 1 chunk +151 lines, -0 lines 0 comments Download
A mojo/services/html_viewer/discardable_memory_allocator_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +76 lines, -0 lines 0 comments Download
M mojo/services/html_viewer/html_viewer.cc View 1 2 3 4 5 6 4 chunks +17 lines, -1 line 0 comments Download

Messages

Total messages: 25 (6 generated)
Elliot Glaysher
Without this, we immediately crash on text input to the google search box on tot ...
5 years, 9 months ago (2015-03-16 20:26:01 UTC) #2
sky
LGTM
5 years, 9 months ago (2015-03-16 21:25:31 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1016493002/1
5 years, 9 months ago (2015-03-16 21:29:42 UTC) #5
Elliot Glaysher
+jamesr: owners stomp
5 years, 9 months ago (2015-03-16 22:03:32 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/50036)
5 years, 9 months ago (2015-03-16 22:05:19 UTC) #9
jamesr
How is this code being reached? In the configuration we're using we shouldn't require any ...
5 years, 9 months ago (2015-03-16 22:34:48 UTC) #10
Elliot Glaysher
On 2015/03/16 22:34:48, jamesr wrote: > How is this code being reached? In the configuration ...
5 years, 9 months ago (2015-03-16 22:49:48 UTC) #11
jamesr
https://codereview.chromium.org/1016493002/diff/1/mojo/services/html_viewer/html_viewer.cc File mojo/services/html_viewer/html_viewer.cc (right): https://codereview.chromium.org/1016493002/diff/1/mojo/services/html_viewer/html_viewer.cc#newcode241 mojo/services/html_viewer/html_viewer.cc:241: // TODO(erg): Skia requires that we have one of ...
5 years, 9 months ago (2015-03-16 23:47:26 UTC) #12
jamesr
If you want something that never discards then return true from Lock() always. I'm not ...
5 years, 9 months ago (2015-03-16 23:51:15 UTC) #13
Elliot Glaysher
ptal I've rewritten the entire patch, and have added tests. (But I'm not sure I ...
5 years, 9 months ago (2015-03-17 20:40:48 UTC) #14
jamesr
Sorry - I still owe you a review here, but I just noticed https://codereview.chromium.org/1001873002/ landed. ...
5 years, 9 months ago (2015-03-17 23:26:20 UTC) #15
Elliot Glaysher
ptal. I've rebased to tot and did your other comments. https://codereview.chromium.org/1016493002/diff/60001/mojo/services/html_viewer/discardable_memory_allocator.h File mojo/services/html_viewer/discardable_memory_allocator.h (right): https://codereview.chromium.org/1016493002/diff/60001/mojo/services/html_viewer/discardable_memory_allocator.h#newcode19 ...
5 years, 9 months ago (2015-03-18 20:36:22 UTC) #16
jamesr
https://codereview.chromium.org/1016493002/diff/100001/mojo/services/html_viewer/discardable_memory_allocator.cc File mojo/services/html_viewer/discardable_memory_allocator.cc (right): https://codereview.chromium.org/1016493002/diff/100001/mojo/services/html_viewer/discardable_memory_allocator.cc#newcode22 mojo/services/html_viewer/discardable_memory_allocator.cc:22: allocator_(nullptr), does it every make sense for allocator_ to ...
5 years, 9 months ago (2015-03-18 22:40:15 UTC) #17
Elliot Glaysher
https://codereview.chromium.org/1016493002/diff/100001/mojo/services/html_viewer/discardable_memory_allocator.cc File mojo/services/html_viewer/discardable_memory_allocator.cc (right): https://codereview.chromium.org/1016493002/diff/100001/mojo/services/html_viewer/discardable_memory_allocator.cc#newcode127 mojo/services/html_viewer/discardable_memory_allocator.cc:127: while (total_live_memory_ > max_memory_ && it != live_chunks_.end()) { ...
5 years, 9 months ago (2015-03-18 23:54:44 UTC) #18
Elliot Glaysher
Redid with keeping track of just the unlocked chunks. Added debugging statements to make sure ...
5 years, 9 months ago (2015-03-19 20:40:24 UTC) #19
jamesr
lgtm https://codereview.chromium.org/1016493002/diff/140001/mojo/services/html_viewer/discardable_memory_allocator.cc File mojo/services/html_viewer/discardable_memory_allocator.cc (right): https://codereview.chromium.org/1016493002/diff/140001/mojo/services/html_viewer/discardable_memory_allocator.cc#newcode18 mojo/services/html_viewer/discardable_memory_allocator.cc:18: explicit OwnedMemoryChunk(size_t size, DiscardableMemoryAllocator* allocator) nit: no explicit ...
5 years, 9 months ago (2015-03-19 22:09:56 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1016493002/160001
5 years, 9 months ago (2015-03-19 22:37:15 UTC) #23
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 9 months ago (2015-03-19 22:59:39 UTC) #24
commit-bot: I haz the power
5 years, 9 months ago (2015-03-19 23:00:15 UTC) #25
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/5f32298dbf36a4c48ef02d18b6acb1f2be759195
Cr-Commit-Position: refs/heads/master@{#321461}

Powered by Google App Engine
This is Rietveld 408576698