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

Issue 1122863005: Create base::win::MemoryPressureMonitor class. (Closed)

Created:
5 years, 7 months ago by chrisha
Modified:
5 years, 7 months ago
CC:
chromium-reviews, grt+watch_chromium.org, jam, darin-cc_chromium.org, asvitkine+watch_chromium.org, wfh+watch_chromium.org, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Create base::win::MemoryPressureMonitor class. This CL creates a polling-based memory pressure monitor for Windows, analogous to that on ChromeOS. BUG=463603, 472772 Committed: https://crrev.com/7a11bb8eef610176358d15b11dc1d7cf3c8bf2e5 Cr-Commit-Position: refs/heads/master@{#328961}

Patch Set 1 #

Total comments: 48

Patch Set 2 : Addressed grt's comments. #

Total comments: 26

Patch Set 3 : Addressed thakis@ and brucedawson@ comments. #

Total comments: 23

Patch Set 4 : Addressed grt@'s comments on patchset 3. #

Total comments: 7

Patch Set 5 : Addressed grt@'s comments on patchset 4. #

Total comments: 4

Patch Set 6 : Addressed grt@'s nits. #

Patch Set 7 : Addressed brucedawson@'s concerns. #

Patch Set 8 : Modify to use new constants, fix fallout. #

Patch Set 9 : Small fixes. #

Patch Set 10 : Rebased. #

Total comments: 22

Patch Set 11 : Addressed brucedawson@ and grt@ comments on patchset 10. #

Patch Set 12 : Fix a typo. #

Patch Set 13 : Rebase and pretty_print to make histograms.xml happy. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+857 lines, -99 lines) Patch
M base/BUILD.gn View 1 2 chunks +3 lines, -0 lines 0 comments Download
M base/base.gyp View 1 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M base/memory/memory_pressure_monitor.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
A base/win/memory_pressure_monitor.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +144 lines, -0 lines 1 comment Download
A base/win/memory_pressure_monitor.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +254 lines, -0 lines 0 comments Download
A base/win/memory_pressure_monitor_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +298 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +33 lines, -0 lines 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 14 chunks +109 lines, -94 lines 0 comments Download

Messages

Total messages: 54 (10 generated)
chrisha
PTAL? asvitkine for histograms.xml avi for content/ thakis for everything else
5 years, 7 months ago (2015-05-05 14:03:04 UTC) #2
Avi (use Gerrit)
content lgtm
5 years, 7 months ago (2015-05-05 15:13:12 UTC) #3
grt (UTC plus 2)
Nice! https://codereview.chromium.org/1122863005/diff/1/base/base.gyp File base/base.gyp (right): https://codereview.chromium.org/1122863005/diff/1/base/base.gyp#newcode657 base/base.gyp:657: 'win/memory_pressure_monitor_win_unittest.cc', nix _win suffix https://codereview.chromium.org/1122863005/diff/1/base/base.gypi File base/base.gypi (right): ...
5 years, 7 months ago (2015-05-05 15:34:00 UTC) #5
chrisha
Thanks for the comments. PTAnotherL? https://codereview.chromium.org/1122863005/diff/1/base/base.gyp File base/base.gyp (right): https://codereview.chromium.org/1122863005/diff/1/base/base.gyp#newcode657 base/base.gyp:657: 'win/memory_pressure_monitor_win_unittest.cc', On 2015/05/05 15:33:59, ...
5 years, 7 months ago (2015-05-05 19:46:13 UTC) #6
Nico
+brucedawson who knows memory stuff well. Bruce, can you spotcheck the memory measuring code in ...
5 years, 7 months ago (2015-05-05 21:25:12 UTC) #8
brucedawson
On 2015/05/05 21:25:12, Nico wrote: > +brucedawson who knows memory stuff well. Bruce, can you ...
5 years, 7 months ago (2015-05-05 21:43:50 UTC) #9
Nico
On Tue, May 5, 2015 at 2:43 PM, <brucedawson@chromium.org> wrote: > On 2015/05/05 21:25:12, Nico ...
5 years, 7 months ago (2015-05-05 21:44:25 UTC) #10
chrisha
The once per second is the same value that they use in ChromeOS. I think ...
5 years, 7 months ago (2015-05-05 21:58:18 UTC) #11
Nico
Do you know why this is an observer-based interface if that can't be implemented efficiently ...
5 years, 7 months ago (2015-05-05 23:28:56 UTC) #12
brucedawson
https://codereview.chromium.org/1122863005/diff/20001/base/win/memory_pressure_monitor.cc File base/win/memory_pressure_monitor.cc (right): https://codereview.chromium.org/1122863005/diff/20001/base/win/memory_pressure_monitor.cc#newcode26 base/win/memory_pressure_monitor.cc:26: const int kMemoryPressureIntervalMs = 1000; All of the functions ...
5 years, 7 months ago (2015-05-06 00:58:28 UTC) #13
chrisha
On 2015/05/05 23:28:56, Nico wrote: > Do you know why this is an observer-based interface ...
5 years, 7 months ago (2015-05-06 01:14:31 UTC) #14
chrisha
Thanks for the detailed comments Nico and Bruce. Made virtual memory checking 32-bit only and ...
5 years, 7 months ago (2015-05-06 02:40:24 UTC) #15
grt (UTC plus 2)
https://codereview.chromium.org/1122863005/diff/1/base/win/memory_pressure_monitor_win.cc File base/win/memory_pressure_monitor_win.cc (right): https://codereview.chromium.org/1122863005/diff/1/base/win/memory_pressure_monitor_win.cc#newcode87 base/win/memory_pressure_monitor_win.cc:87: return current_memory_pressure_level_; On 2015/05/05 19:46:12, chrisha wrote: > On ...
5 years, 7 months ago (2015-05-06 13:26:36 UTC) #16
chrisha
Okay, another round of cleanup. PTAL? https://codereview.chromium.org/1122863005/diff/1/base/win/memory_pressure_monitor_win.cc File base/win/memory_pressure_monitor_win.cc (right): https://codereview.chromium.org/1122863005/diff/1/base/win/memory_pressure_monitor_win.cc#newcode87 base/win/memory_pressure_monitor_win.cc:87: return current_memory_pressure_level_; On ...
5 years, 7 months ago (2015-05-06 15:09:58 UTC) #17
grt (UTC plus 2)
https://codereview.chromium.org/1122863005/diff/40001/base/win/memory_pressure_monitor.h File base/win/memory_pressure_monitor.h (right): https://codereview.chromium.org/1122863005/diff/40001/base/win/memory_pressure_monitor.h#newcode15 base/win/memory_pressure_monitor.h:15: // To not pull in windows.h. On 2015/05/06 15:09:57, ...
5 years, 7 months ago (2015-05-06 16:31:09 UTC) #18
Alexei Svitkine (slow)
histograms lgtm
5 years, 7 months ago (2015-05-06 16:34:24 UTC) #19
chrisha
Okay, that should do it for grt@'s comments. brucedawson@, it'd be great to have your ...
5 years, 7 months ago (2015-05-06 16:59:04 UTC) #20
grt (UTC plus 2)
lgtm w/ the test fixes https://codereview.chromium.org/1122863005/diff/60001/base/win/memory_pressure_monitor.cc File base/win/memory_pressure_monitor.cc (right): https://codereview.chromium.org/1122863005/diff/60001/base/win/memory_pressure_monitor.cc#newcode130 base/win/memory_pressure_monitor.cc:130: moderate_pressure_repeat_count_ = 0; On ...
5 years, 7 months ago (2015-05-06 18:14:58 UTC) #21
brucedawson
https://codereview.chromium.org/1122863005/diff/80001/base/win/memory_pressure_monitor.cc File base/win/memory_pressure_monitor.cc (right): https://codereview.chromium.org/1122863005/diff/80001/base/win/memory_pressure_monitor.cc#newcode23 base/win/memory_pressure_monitor.cc:23: const int kModerateThresholdPercent = 60; I'm not sure that ...
5 years, 7 months ago (2015-05-06 18:44:37 UTC) #22
chrisha
On 2015/05/06 18:44:37, brucedawson wrote: > https://codereview.chromium.org/1122863005/diff/80001/base/win/memory_pressure_monitor.cc > File base/win/memory_pressure_monitor.cc (right): > > https://codereview.chromium.org/1122863005/diff/80001/base/win/memory_pressure_monitor.cc#newcode23 > ...
5 years, 7 months ago (2015-05-06 20:45:21 UTC) #23
brucedawson
> Thanks, this is exactly the kind of discussion I was hoping for. The constants ...
5 years, 7 months ago (2015-05-06 20:49:17 UTC) #24
Nico
Do you have a CL that shows how this will be used? I'm not worried ...
5 years, 7 months ago (2015-05-06 22:57:15 UTC) #25
brucedawson
On 2015/05/06 22:57:15, Nico wrote: > Do you have a CL that shows how this ...
5 years, 7 months ago (2015-05-06 23:44:54 UTC) #26
chrisha
On 2015/05/06 22:57:15, Nico wrote: > Do you have a CL that shows how this ...
5 years, 7 months ago (2015-05-06 23:48:39 UTC) #27
chrisha
On 2015/05/06 23:44:54, brucedawson wrote: > On 2015/05/06 22:57:15, Nico wrote: > > Do you ...
5 years, 7 months ago (2015-05-07 00:04:32 UTC) #28
chrisha
This has changed substantially since implementing Bruce's suggestions, so is worthy of another once over. ...
5 years, 7 months ago (2015-05-07 00:49:28 UTC) #29
brucedawson
Just took a quick look and it looks reasonable. I'll look more closely tomorrow.
5 years, 7 months ago (2015-05-07 00:57:16 UTC) #30
grt (UTC plus 2)
https://codereview.chromium.org/1122863005/diff/180001/base/win/memory_pressure_monitor.h File base/win/memory_pressure_monitor.h (right): https://codereview.chromium.org/1122863005/diff/180001/base/win/memory_pressure_monitor.h#newcode21 base/win/memory_pressure_monitor.h:21: class TestMemoryPressureMonitor; in previous reads, i thought that this ...
5 years, 7 months ago (2015-05-07 02:12:12 UTC) #31
brucedawson
I reviewed base/win/memory_pressure_monitor.cc. I made a few suggestions for making the comments clearer but otherwise ...
5 years, 7 months ago (2015-05-07 19:45:58 UTC) #32
chrisha
Thanks all. grt@, one last look? https://codereview.chromium.org/1122863005/diff/180001/base/win/memory_pressure_monitor.cc File base/win/memory_pressure_monitor.cc (right): https://codereview.chromium.org/1122863005/diff/180001/base/win/memory_pressure_monitor.cc#newcode60 base/win/memory_pressure_monitor.cc:60: // A system ...
5 years, 7 months ago (2015-05-07 21:17:37 UTC) #33
grt (UTC plus 2)
lgtm
5 years, 7 months ago (2015-05-08 03:31:55 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1122863005/220001
5 years, 7 months ago (2015-05-08 03:36:21 UTC) #37
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/62052)
5 years, 7 months ago (2015-05-08 03:43:35 UTC) #39
Nico
On 2015/05/08 03:43:35, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
5 years, 7 months ago (2015-05-08 04:29:31 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1122863005/220001
5 years, 7 months ago (2015-05-08 04:47:29 UTC) #42
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/62069)
5 years, 7 months ago (2015-05-08 04:54:18 UTC) #44
grt (UTC plus 2)
Chris, The commit failed due to a formatting error. One small fix and you're good ...
5 years, 7 months ago (2015-05-08 13:02:15 UTC) #45
chrisha
On 2015/05/08 13:02:15, grt wrote: > Chris, > > The commit failed due to a ...
5 years, 7 months ago (2015-05-08 13:06:06 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1122863005/240001
5 years, 7 months ago (2015-05-08 13:06:31 UTC) #49
grt (UTC plus 2)
On 2015/05/08 13:06:06, chrisha wrote: > On 2015/05/08 13:02:15, grt wrote: > > Chris, > ...
5 years, 7 months ago (2015-05-08 14:16:27 UTC) #50
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 7 months ago (2015-05-08 15:39:50 UTC) #51
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/7a11bb8eef610176358d15b11dc1d7cf3c8bf2e5 Cr-Commit-Position: refs/heads/master@{#328961}
5 years, 7 months ago (2015-05-08 15:40:48 UTC) #52
Nico
https://codereview.chromium.org/1122863005/diff/240001/base/win/memory_pressure_monitor.h File base/win/memory_pressure_monitor.h (right): https://codereview.chromium.org/1122863005/diff/240001/base/win/memory_pressure_monitor.h#newcode133 base/win/memory_pressure_monitor.h:133: base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_; Sorry about missing this: ..\..\base/win/memory_pressure_monitor.h(133,47) : warning(clang): ...
5 years, 7 months ago (2015-05-08 18:06:15 UTC) #53
chrisha
5 years, 7 months ago (2015-05-08 19:23:42 UTC) #54
Message was sent while issue was closed.
No, doing the mac/cros rename in a separate CL. Will also take care of the
style issue. Thanks for the heads up.

On Fri, 8 May 2015 at 14:06 <thakis@chromium.org> wrote:

>
>
>
https://codereview.chromium.org/1122863005/diff/240001/base/win/memory_pressu...
> File base/win/memory_pressure_monitor.h (right):
>
>
>
https://codereview.chromium.org/1122863005/diff/240001/base/win/memory_pressu...
> base/win/memory_pressure_monitor.h:133
>
<https://codereview.chromium.org/1122863005/diff/240001/base/win/memory_pressu...>
> :
> base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_;
> Sorry about missing this:
>
> ..\..\base/win/memory_pressure_monitor.h(133,47) :  warning(clang):
> [chromium-style] WeakPtrFactory members which refer to their outer class
> must be the last member in the outer class definition.
>    base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_;
>                                                ^
>
> (also, did the mac / cros files get moved to be consistent with the
> naming of this file yet?)
>
> https://codereview.chromium.org/1122863005/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698