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

Unified Diff: base/process/process_metrics.h

Issue 2070083002: Add Linux MemAvailable to SystemMemoryInfoKB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude Android and improve commenting Created 4 years, 6 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 | base/process/process_metrics_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics.h
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h
index 8d4e51b517d78ed4cb497b983cadb8325f35addc..57cb3abec0d20e3249d029da319c96f2e10ab58b 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -272,6 +272,14 @@ struct BASE_EXPORT SystemMemoryInfoKB {
int total;
int free;
+#if defined(OS_LINUX)
+ // This provides an estimate of available memory as described here:
+ // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
+ // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always
+ // be 0 in earlier kernel versions.
+ int available;
+#endif
+
#if !defined(OS_MACOSX)
int swap_total;
int swap_free;
« no previous file with comments | « no previous file | base/process/process_metrics_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698