Chromium Code Reviews
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. #
Messages
Total messages: 14 (6 generated)
|
|||||||||||||||||||||||||||||||||||||