New issue
Advanced search Search tips

Issue 655304 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

[Mac] Capture memory pressure stats in UMA

Project Member Reported by shrike@chromium.org, Oct 12 2016

Issue description

Currently the memory pressure monitoring system captures memory pressure level data in UMA (Memory.PressureLevel) on Windows. We should be capturing the same info on the Mac.

https://uma.googleplex.com/p/chrome/timeline_v2/?sid=bbf2e336653b4407331ca61e7b5ac962

 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 7 2016

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f518237b7651d1eeb115bffcc51f11ee0e9078cc

commit f518237b7651d1eeb115bffcc51f11ee0e9078cc
Author: lgrey <lgrey@chromium.org>
Date: Mon Nov 28 15:51:57 2016

[Mac] Report statistics more regularly in Mac memory pressure monitor

Currently, we only report UMA statistics on receiving a pressure
change event from the system. This means that we could be missing
many ticks of "normal" pressure from sessions that never encounter
pressure, skewing our stats. Other platforms don't have this issue
since they poll.

This change piggybacks statistic reporting on GetCurrentPressureLevel()
which is called regularly by RendererFrameManager::GetMaxNumberOfSavedFrames()
This also allows us to enable reporting for Sierra.

To make this work, GetCurrentPressureLevel is now declared non-const.
There don't appear to be any const MemoryPressureMonitors in the codebase
at the moment, so this should be safe.

BUG= 655304 

Review-Url: https://codereview.chromium.org/2495003004
Cr-Commit-Position: refs/heads/master@{#434660}

[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/base/memory/memory_pressure_monitor.h
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/base/memory/memory_pressure_monitor_chromeos.cc
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/base/memory/memory_pressure_monitor_chromeos.h
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/base/memory/memory_pressure_monitor_mac.cc
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/base/memory/memory_pressure_monitor_mac.h
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/base/memory/memory_pressure_monitor_win.cc
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/base/memory/memory_pressure_monitor_win.h
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/chromecast/browser/cast_memory_pressure_monitor.cc
[modify] https://crrev.com/f518237b7651d1eeb115bffcc51f11ee0e9078cc/chromecast/browser/cast_memory_pressure_monitor.h

Comment 3 by lgrey@chromium.org, Dec 2 2016

Status: Fixed (was: Assigned)
Looks like we're getting data for canary. Comparing vs. Windows canary, it percentage of time spent in moderate/critical pressure is lower, but I'm not sure if that's a difference between what platforms consider critical, more low-end Windows machines, programmer error or one of another million reasons. Marking fixed for now nonetheless.
I was looking at this data last night - great to have it!

It appears that on Windows, the memory pressure levels are based on free memory being within certain ranges whereas on the Mac it's based on if the system is compressing pages in RAM (WARNING) or swapping to disk (CRITICAL). As I see it the different platform memory pressures are therefore not comparable because on Windows, WARNING means you have less free memory available but on the Mac there might be ample free memory that can be reclaimed through compression.

Sign in to add a comment