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

Issue 1587273002: [Mac] Collect real-time memory pressure stats, in an energy-efficient way (Closed)

Created:
4 years, 11 months ago by shrike
Modified:
3 years, 9 months ago
Reviewers:
Mark Mentovai, lgrey
CC:
chromium-reviews, sadrul, gavinp+memory_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Collect real-time memory pressure stats, in an energy-efficient way macOS sends memory pressure change notifications, but those notifications lag the memory pressure change event by up to 60s. For accurate memory pressure change statistics we want a more timely pressure change signal. The only way to do that is with polling, but using a timer means consuming more CPU. This cl adds a CFRunLoopObserver that updates the current memory pressure level at the end of every run loop pass (modulo 5s), allowing UMA to accurately track the time spent in the different memory pressure states. BUG=569166 Review-Url: https://codereview.chromium.org/1587273002 Cr-Commit-Position: refs/heads/master@{#454880} Committed: https://chromium.googlesource.com/chromium/src/+/c26b5914b28e0a145481fec6d942f0dbba97e227

Patch Set 1 #

Patch Set 2 : Add a lock in MemoryPressureMonitorMac. #

Patch Set 3 : Reimplement using CFRunLoopObserver hook. #

Patch Set 4 : Refactor, add tests. #

Patch Set 5 : Added tests, checkpoint. #

Patch Set 6 : Fix nits. #

Total comments: 7

Patch Set 7 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+347 lines, -79 lines) Patch
M base/memory/memory_pressure_monitor_mac.h View 1 2 3 4 5 6 2 chunks +37 lines, -8 lines 0 comments Download
M base/memory/memory_pressure_monitor_mac.cc View 1 2 3 4 5 6 4 chunks +118 lines, -46 lines 0 comments Download
M base/memory/memory_pressure_monitor_mac_unittest.cc View 1 2 3 4 5 3 chunks +192 lines, -25 lines 0 comments Download

Messages

Total messages: 14 (6 generated)
shrike
lgrey@ - PTAL
3 years, 10 months ago (2017-02-22 20:46:36 UTC) #3
lgrey
https://codereview.chromium.org/1587273002/diff/100001/base/memory/memory_pressure_monitor_mac.cc File base/memory/memory_pressure_monitor_mac.cc (right): https://codereview.chromium.org/1587273002/diff/100001/base/memory/memory_pressure_monitor_mac.cc#newcode154 base/memory/memory_pressure_monitor_mac.cc:154: next_run_loop_update_time_ = now + kUMATickSize; Should we account for ...
3 years, 10 months ago (2017-02-22 21:33:40 UTC) #4
shrike
https://codereview.chromium.org/1587273002/diff/100001/base/memory/memory_pressure_monitor_mac.cc File base/memory/memory_pressure_monitor_mac.cc (right): https://codereview.chromium.org/1587273002/diff/100001/base/memory/memory_pressure_monitor_mac.cc#newcode154 base/memory/memory_pressure_monitor_mac.cc:154: next_run_loop_update_time_ = now + kUMATickSize; On 2017/02/22 21:33:40, lgrey ...
3 years, 10 months ago (2017-02-22 23:56:25 UTC) #5
lgrey
LGTM https://codereview.chromium.org/1587273002/diff/100001/base/memory/memory_pressure_monitor_mac_unittest.cc File base/memory/memory_pressure_monitor_mac_unittest.cc (right): https://codereview.chromium.org/1587273002/diff/100001/base/memory/memory_pressure_monitor_mac_unittest.cc#newcode202 base/memory/memory_pressure_monitor_mac_unittest.cc:202: EXPECT_EQ(2, monitor.SubTickSeconds()); On 2017/02/22 23:56:25, shrike wrote: > ...
3 years, 10 months ago (2017-02-23 15:49:29 UTC) #6
shrike
mark@ - PTAL (owner's approval)
3 years, 10 months ago (2017-02-23 17:33:38 UTC) #8
Mark Mentovai
LGTM
3 years, 10 months ago (2017-02-23 18:52:02 UTC) #9
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/1587273002/120001
3 years, 9 months ago (2017-03-06 16:48:18 UTC) #11
commit-bot: I haz the power
3 years, 9 months ago (2017-03-06 17:20:42 UTC) #14
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/c26b5914b28e0a145481fec6d942...

Powered by Google App Engine
This is Rietveld 408576698