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

Unified Diff: chrome/browser/chromeos/memory/oom_priority_manager.h

Issue 12221159: Add out of memory stats for graphics memory, discards per minute (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/memory/oom_priority_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/memory/oom_priority_manager.h
diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.h b/chrome/browser/chromeos/memory/oom_priority_manager.h
index 2b988191b68c3edc3db8429d04812fe205654361..a6cf70495312c6b878b9417c9f724176a1d09fb5 100644
--- a/chrome/browser/chromeos/memory/oom_priority_manager.h
+++ b/chrome/browser/chromeos/memory/oom_priority_manager.h
@@ -42,6 +42,9 @@ class OomPriorityManager : public content::NotificationObserver {
// Number of discard events since Chrome started.
int discard_count() const { return discard_count_; }
+ // See member comment.
+ bool recent_tab_discard() const { return recent_tab_discard_; }
+
void Start();
void Stop();
@@ -91,6 +94,10 @@ class OomPriorityManager : public content::NotificationObserver {
// to manually test the system.
void RecordDiscardStatistics();
+ // Record whether we ran out of memory during a recent time interval.
+ // This allows us to normalize low memory statistics versus usage.
+ void RecordRecentTabDiscard();
+
// Purges data structures in the browser that can be easily recomputed.
void PurgeBrowserMemory();
@@ -119,6 +126,7 @@ class OomPriorityManager : public content::NotificationObserver {
base::RepeatingTimer<OomPriorityManager> timer_;
base::OneShotTimer<OomPriorityManager> focus_tab_score_adjust_timer_;
+ base::RepeatingTimer<OomPriorityManager> recent_tab_discard_timer_;
content::NotificationRegistrar registrar_;
// This lock is for pid_to_oom_score_ and focus_tab_pid_.
@@ -146,6 +154,10 @@ class OomPriorityManager : public content::NotificationObserver {
// Number of times we have discarded a tab, for statistics.
int discard_count_;
+ // Whether a tab discard event has occurred during the last time interval,
+ // used for statistics normalized by usage.
+ bool recent_tab_discard_;
+
DISALLOW_COPY_AND_ASSIGN(OomPriorityManager);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/memory/oom_priority_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698