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

Issue 336273003: base: Add soft memory limit to DiscardableMemoryManager. (Closed)

Created:
6 years, 6 months ago by reveman
Modified:
6 years, 5 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, gavinp+memory_chromium.org
Project:
chromium
Visibility:
Public.

Description

base: Add soft memory limit to DiscardableMemoryManager. This adds a soft memory limit to the discardable memory manager. Only allocations that haven't been used in specific amount of time are affected by this limit. This allows a client to use a much higher hard limit so temporary spikes in required usage can be handled efficiently without causing an increase in usage while idle. A "reduce memory usage" function is added to the discardable memory interface to allow the client to effectively trigger purging of memory that is affected by the soft limit when system reaches what would be considered an idle state. BUG=383361, 372158 TEST=base_unittests --gtest_filter=DiscardableMemoryManagerTest.ReduceMemoryUsage Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281795

Patch Set 1 #

Patch Set 2 : v2 #

Total comments: 2

Patch Set 3 : cl format #

Patch Set 4 : fix typo in comment #

Total comments: 9

Patch Set 5 : address review feedback #

Total comments: 4

Patch Set 6 : remove incorrect comment and make Now() private #

Patch Set 7 : fix mac build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -53 lines) Patch
M base/memory/discardable_memory.h View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M base/memory/discardable_memory_android.cc View 1 2 3 4 5 2 chunks +9 lines, -1 line 0 comments Download
M base/memory/discardable_memory_emulated.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M base/memory/discardable_memory_emulated.cc View 1 2 3 4 2 chunks +8 lines, -1 line 0 comments Download
M base/memory/discardable_memory_linux.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M base/memory/discardable_memory_mac.cc View 1 2 3 4 5 6 2 chunks +10 lines, -1 line 0 comments Download
M base/memory/discardable_memory_manager.h View 1 2 3 4 5 7 chunks +46 lines, -13 lines 0 comments Download
M base/memory/discardable_memory_manager.cc View 1 2 3 4 12 chunks +68 lines, -30 lines 0 comments Download
M base/memory/discardable_memory_manager_unittest.cc View 1 2 3 4 5 4 chunks +76 lines, -4 lines 0 comments Download
M base/memory/discardable_memory_win.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 2 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
reveman
This seems to be working well. Allocations not used for some time are effected by ...
6 years, 6 months ago (2014-06-20 03:36:27 UTC) #1
Stephen White
This seems reasonable. One concern I have (possibly stemming from ignorance): can a spinning CPU ...
6 years, 6 months ago (2014-06-20 14:06:01 UTC) #2
Justin Novosad
I think this is a great improvement but I am still concerned that if the ...
6 years, 6 months ago (2014-06-20 14:43:47 UTC) #3
reveman
https://codereview.chromium.org/336273003/diff/20001/base/memory/discardable_memory_android.cc File base/memory/discardable_memory_android.cc (right): https://codereview.chromium.org/336273003/diff/20001/base/memory/discardable_memory_android.cc#newcode61 base/memory/discardable_memory_android.cc:61: return internal::DiscardableMemoryEmulated::IdleNotification(); On 2014/06/20 14:06:01, Stephen White wrote: > ...
6 years, 6 months ago (2014-06-20 18:06:29 UTC) #4
reveman
On 2014/06/20 14:06:01, Stephen White wrote: > This seems reasonable. One concern I have (possibly ...
6 years, 6 months ago (2014-06-20 18:11:37 UTC) #5
Stephen White
On 2014/06/20 18:11:37, reveman wrote: > On 2014/06/20 14:06:01, Stephen White wrote: > > This ...
6 years, 6 months ago (2014-06-20 18:12:58 UTC) #6
reveman
On 2014/06/20 14:43:47, junov wrote: > I think this is a great improvement but I ...
6 years, 6 months ago (2014-06-20 18:36:37 UTC) #7
reveman
jamesr can you take a look at content/renderer/ changes? willchan for owner review of base/memory ...
6 years, 6 months ago (2014-06-23 14:59:41 UTC) #8
willchan no longer on Chromium
Note that I'm still traveling, so expect high latency. https://codereview.chromium.org/336273003/diff/60001/base/memory/discardable_memory_manager.h File base/memory/discardable_memory_manager.h (right): https://codereview.chromium.org/336273003/diff/60001/base/memory/discardable_memory_manager.h#newcode169 base/memory/discardable_memory_manager.h:169: ...
6 years, 6 months ago (2014-06-24 16:33:00 UTC) #9
jamesr
When do you hope this function will be called?
6 years, 6 months ago (2014-06-24 17:48:10 UTC) #10
reveman
On 2014/06/24 17:48:10, jamesr wrote: > When do you hope this function will be called? ...
6 years, 6 months ago (2014-06-24 20:03:24 UTC) #11
jamesr
I think this is pretty reasonable. It's using the idle handler to potentially toss memory, ...
6 years, 6 months ago (2014-06-24 20:22:54 UTC) #12
reveman
On 2014/06/24 20:22:54, jamesr wrote: > I think this is pretty reasonable. It's using the ...
6 years, 6 months ago (2014-06-24 21:00:21 UTC) #13
willchan no longer on Chromium
https://codereview.chromium.org/336273003/diff/60001/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://codereview.chromium.org/336273003/diff/60001/base/memory/discardable_memory.h#newcode100 base/memory/discardable_memory.h:100: // Call this when idle. Discardable memory implementations might ...
6 years, 5 months ago (2014-06-27 14:12:57 UTC) #14
reveman
PTAL https://codereview.chromium.org/336273003/diff/60001/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://codereview.chromium.org/336273003/diff/60001/base/memory/discardable_memory.h#newcode100 base/memory/discardable_memory.h:100: // Call this when idle. Discardable memory implementations ...
6 years, 5 months ago (2014-06-27 20:38:02 UTC) #15
willchan no longer on Chromium
lgtm https://codereview.chromium.org/336273003/diff/80001/base/memory/discardable_memory_manager.h File base/memory/discardable_memory_manager.h (right): https://codereview.chromium.org/336273003/diff/80001/base/memory/discardable_memory_manager.h#newcode68 base/memory/discardable_memory_manager.h:68: // When notified that idle, the manager purges ...
6 years, 5 months ago (2014-07-07 22:28:08 UTC) #16
reveman
https://codereview.chromium.org/336273003/diff/80001/base/memory/discardable_memory_manager.h File base/memory/discardable_memory_manager.h (right): https://codereview.chromium.org/336273003/diff/80001/base/memory/discardable_memory_manager.h#newcode68 base/memory/discardable_memory_manager.h:68: // When notified that idle, the manager purges memory ...
6 years, 5 months ago (2014-07-07 23:49:03 UTC) #17
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 5 months ago (2014-07-07 23:49:47 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/336273003/100001
6 years, 5 months ago (2014-07-07 23:52:09 UTC) #19
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 5 months ago (2014-07-08 03:22:21 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-08 03:24:27 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/ios_dbg_simulator/builds/168040) ios_rel_device on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/ios_rel_device/builds/157137) ios_rel_device_ninja ...
6 years, 5 months ago (2014-07-08 03:24:28 UTC) #22
reveman
The CQ bit was checked by reveman@chromium.org
6 years, 5 months ago (2014-07-08 15:54:39 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/336273003/120001
6 years, 5 months ago (2014-07-08 15:55:25 UTC) #24
commit-bot: I haz the power
6 years, 5 months ago (2014-07-08 19:31:31 UTC) #25
Message was sent while issue was closed.
Change committed as 281795

Powered by Google App Engine
This is Rietveld 408576698