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

Issue 2479673002: Expose MemoryCoordinator's global budget information. (Closed)

Created:
4 years, 1 month ago by chrisha
Modified:
3 years, 11 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, jam, gavinp+memory_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, darin (slow to review)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Expose MemoryCoordinator's global budget information. This information will be used by V8 to tweak its memory usage in real time. BUG=

Patch Set 1 #

Patch Set 2 : Small cleanup. #

Total comments: 27
Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -14 lines) Patch
M base/memory/memory_coordinator_proxy.h View 1 4 chunks +15 lines, -0 lines 6 comments Download
M base/memory/memory_coordinator_proxy.cc View 3 chunks +13 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/memory/memory_coordinator.h View 2 chunks +13 lines, -0 lines 0 comments Download
M content/browser/memory/memory_coordinator.cc View 2 chunks +22 lines, -0 lines 0 comments Download
M content/browser/memory/memory_coordinator_impl.h View 1 4 chunks +11 lines, -4 lines 2 comments Download
M content/browser/memory/memory_coordinator_impl.cc View 6 chunks +43 lines, -7 lines 17 comments Download
M content/child/memory/child_memory_coordinator_impl.h View 2 chunks +18 lines, -0 lines 0 comments Download
M content/child/memory/child_memory_coordinator_impl.cc View 4 chunks +27 lines, -3 lines 2 comments Download
M content/common/child_memory_coordinator.mojom View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (3 generated)
chrisha
PTAL?
4 years, 1 month ago (2016-11-04 19:49:37 UTC) #2
haraken
Can we add a test? https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/memory_coordinator_impl.cc File content/browser/memory/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/memory_coordinator_impl.cc#newcode201 content/browser/memory/memory_coordinator_impl.cc:201: renderer_count = new_renderers_back_to_normal_; Shouldn't ...
4 years, 1 month ago (2016-11-05 12:52:22 UTC) #3
bashi
Thank you for adding this! https://codereview.chromium.org/2479673002/diff/20001/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2479673002/diff/20001/base/memory/memory_coordinator_proxy.h#newcode18 base/memory/memory_coordinator_proxy.h:18: // is injected. +1 ...
4 years, 1 month ago (2016-11-07 00:16:37 UTC) #4
haraken
On 2016/11/07 00:16:37, bashi1 wrote: > Thank you for adding this! > > https://codereview.chromium.org/2479673002/diff/20001/base/memory/memory_coordinator_proxy.h > ...
4 years, 1 month ago (2016-11-07 01:44:40 UTC) #5
bashi
On 2016/11/07 01:44:40, haraken wrote: > On 2016/11/07 00:16:37, bashi1 wrote: > > Thank you ...
4 years, 1 month ago (2016-11-07 02:02:22 UTC) #6
haraken
On 2016/11/07 02:02:22, bashi1 wrote: > On 2016/11/07 01:44:40, haraken wrote: > > On 2016/11/07 ...
4 years, 1 month ago (2016-11-07 02:07:57 UTC) #7
chrisha
Thinking this over more, I agree that a "pull" makes more sense here. I'll rewrite ...
4 years, 1 month ago (2016-11-07 19:33:42 UTC) #8
bashi
https://codereview.chromium.org/2479673002/diff/20001/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2479673002/diff/20001/base/memory/memory_coordinator_proxy.h#newcode18 base/memory/memory_coordinator_proxy.h:18: // is injected. On 2016/11/07 19:33:41, chrisha (slow) wrote: ...
4 years, 1 month ago (2016-11-07 23:17:08 UTC) #9
Hannes Payer (out of office)
https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/memory_coordinator_impl.cc File content/browser/memory/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/memory_coordinator_impl.cc#newcode86 content/browser/memory/memory_coordinator_impl.cc:86: expected_renderer_size_ = kDefaultExpectedRendererSizeMB; Unrelated to this CL: How did ...
4 years, 1 month ago (2016-11-11 12:55:19 UTC) #11
bashi
https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/memory_coordinator_impl.cc File content/browser/memory/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/memory_coordinator_impl.cc#newcode86 content/browser/memory/memory_coordinator_impl.cc:86: expected_renderer_size_ = kDefaultExpectedRendererSizeMB; On 2016/11/11 12:55:19, Hannes Payer wrote: ...
4 years, 1 month ago (2016-11-12 01:30:53 UTC) #12
chrisha
4 years ago (2016-12-15 21:10:24 UTC) #13
Closing this for now. bashi@ is refactoring the base::MemoryCoordinator, and
we'll do this on top of his changes.

https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/...
File content/browser/memory/memory_coordinator_impl.cc (right):

https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/...
content/browser/memory/memory_coordinator_impl.cc:237: if (prev_remaining !=
next_remaining) {
On 2016/11/07 19:33:41, chrisha (slow) wrote:
> On 2016/11/07 00:16:37, bashi1 wrote:
> > How likely does this condition become true? |free_memory_until_critical_mb|
> > isn't stable as far as I tested and I guess that |prev_remaining| and
> > |next_remaining| wouldn't be the same in most cases.
> 
> Very unlikely to remain true, but this is a cheap comparison that avoids an
> expensive IPC. The IPC costs many orders of magnitude more effort than the
> comparison, so it doesn't have to be true very often for the trade-off to be
> worth it.

(This is a moot point with a "pull" model.)

https://codereview.chromium.org/2479673002/diff/20001/content/browser/memory/...
content/browser/memory/memory_coordinator_impl.cc:239:
NotifyRemainingGlobalBudgetToChildren();
On 2016/11/07 19:33:41, chrisha (slow) wrote:
> On 2016/11/07 00:16:37, bashi1 wrote:
> > On 2016/11/05 12:52:21, haraken wrote:
> > > 
> > > How frequently will this IPC be called?
> > 
> > My guess is that it's almost the same as how frequently UpdateState() is
> called,
> > which means that every 5 seconds in general.
> 
> Yup. Although we should likely still continue to compute it even during the
> period of no action following a state change.
> 
> > Instead of pushing budgets, how about adding a pull IPC method which a
> renderer
> > can ask the browser the current budget?
> 
> Yeah, I'm ambivalent here. I think a pull API could be useful, but we'd likely
> want some kind of caching + rate limiting.

Moved to a "pull" model.

Powered by Google App Engine
This is Rietveld 408576698