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

Issue 2655083003: Add OnPurgeMemory() to MemoryCoordinatorClient (Closed)

Created:
3 years, 10 months ago by bashi
Modified:
3 years, 10 months ago
Reviewers:
haraken, chrisha, dcheng
CC:
chromium-reviews, gavinp+memory_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add OnPurgeMemory() to MemoryCoordinatorClient Before this CL, MemoryCoordinatorClient has only one callback called OnMemoryStateChange(). Clients try to free up memory when state change happens (e.g. NORMAL -> SUSPENDED). This may not be a good strategy on some platforms because we may touch compressed pages (see [1] for details). This CL add another callback called OnPurgeMemory() to separate logic for purging existing memory from memory state changes. This way we can build flexible strategies for handling memory pressure. [1] https://groups.google.com/a/chromium.org/forum/?utm_medium=email&utm_source=footer#!msg/project-trim/s96xSirL2Hs/18uq1zfHEgAJ BUG=684287 Review-Url: https://codereview.chromium.org/2655083003 Cr-Commit-Position: refs/heads/master@{#446951} Committed: https://chromium.googlesource.com/chromium/src/+/a7f5cbbe7f704ea74d57b7413a7b10b7a1b68750

Patch Set 1 #

Total comments: 8

Patch Set 2 : comments #

Total comments: 2

Patch Set 3 : comment #

Patch Set 4 : comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -18 lines) Patch
M base/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M base/memory/memory_coordinator_client.h View 1 2 3 3 chunks +30 lines, -18 lines 0 comments Download
M base/memory/memory_coordinator_client_registry.h View 1 chunk +3 lines, -0 lines 0 comments Download
M base/memory/memory_coordinator_client_registry.cc View 1 chunk +4 lines, -0 lines 0 comments Download
A base/memory/memory_coordinator_client_registry_unittest.cc View 1 chunk +58 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (17 generated)
bashi
PTAL? In follow-up CLs I'll move existing purging logic in clients to OnPurgeMemory(). (like https://codereview.chromium.org/2648323005/)
3 years, 10 months ago (2017-01-26 01:57:51 UTC) #4
haraken
LGTM https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h File base/memory/memory_coordinator_client.h (right): https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h#newcode60 base/memory/memory_coordinator_client.h:60: // * THROTTLED: Use smaller limits for memory ...
3 years, 10 months ago (2017-01-26 05:53:12 UTC) #7
bashi
https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h File base/memory/memory_coordinator_client.h (right): https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h#newcode60 base/memory/memory_coordinator_client.h:60: // * THROTTLED: Use smaller limits for memory allocations ...
3 years, 10 months ago (2017-01-26 07:10:01 UTC) #9
dcheng
https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h File base/memory/memory_coordinator_client.h (right): https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h#newcode62 base/memory/memory_coordinator_client.h:62: // because releasing resources will be done by OnPurgeMemory(). ...
3 years, 10 months ago (2017-01-26 08:45:32 UTC) #11
chrisha
lgtm! https://codereview.chromium.org/2655083003/diff/20001/base/memory/memory_coordinator_client.h File base/memory/memory_coordinator_client.h (right): https://codereview.chromium.org/2655083003/diff/20001/base/memory/memory_coordinator_client.h#newcode24 base/memory/memory_coordinator_client.h:24: // well. A comment that OnMemoryStateChange should only ...
3 years, 10 months ago (2017-01-26 22:17:35 UTC) #14
bashi
https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h File base/memory/memory_coordinator_client.h (right): https://codereview.chromium.org/2655083003/diff/1/base/memory/memory_coordinator_client.h#newcode62 base/memory/memory_coordinator_client.h:62: // because releasing resources will be done by OnPurgeMemory(). ...
3 years, 10 months ago (2017-01-26 23:45:00 UTC) #16
dcheng
rs lgtm for base I do feel like the guidelines for the different states could ...
3 years, 10 months ago (2017-01-27 09:19:08 UTC) #20
bashi
On 2017/01/27 09:19:08, dcheng wrote: > rs lgtm for base > > I do feel ...
3 years, 10 months ago (2017-01-30 00:04:00 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2655083003/60001
3 years, 10 months ago (2017-01-30 00:04:39 UTC) #24
commit-bot: I haz the power
3 years, 10 months ago (2017-01-30 01:07:15 UTC) #27
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/a7f5cbbe7f704ea74d57b7413a7b...

Powered by Google App Engine
This is Rietveld 408576698