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

Unified Diff: base/process/process_metrics.h

Issue 2558043007: Fix free memory calculation. (Closed)
Patch Set: Fix comment formatting. Created 3 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 | base/process/process_metrics_ios.cc » ('j') | base/process/process_metrics_linux.cc » ('J')
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 2448a715ace9b5eade7f09524561ffcedb666cc3..a9cadc8ffeebbd64d49579afe0fd8dfc3a900f60 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -264,8 +264,9 @@ BASE_EXPORT void SetFdLimit(unsigned int max_descriptors);
// Total/free memory are available on all platforms that implement
// GetSystemMemoryInfo(). Total/free swap memory are available on all platforms
// except on Mac. Buffers/cached/active_anon/inactive_anon/active_file/
-// inactive_file/dirty/pswpin/pswpout/pgmajfault are available on
+// inactive_file/dirty/reclaimable/pswpin/pswpout/pgmajfault are available on
// Linux/Android/Chrome OS. Shmem/slab/gem_objects/gem_size are Chrome OS only.
+// Speculative/file_backed/purgeable are Mac and iOS only.
struct BASE_EXPORT SystemMemoryInfoKB {
SystemMemoryInfoKB();
SystemMemoryInfoKB(const SystemMemoryInfoKB& other);
@@ -276,7 +277,13 @@ struct BASE_EXPORT SystemMemoryInfoKB {
int total;
int free;
-#if defined(OS_LINUX)
+#if defined(OS_WIN)
+ int zero;
Primiano Tucci (use gerrit) 2017/02/15 11:18:33 what is this?
Michael K. (Yandex Team) 2017/02/17 13:38:47 Done.
+ // On Windows this field has different meaning from the Linux one.
Primiano Tucci (use gerrit) 2017/02/15 11:18:33 nit: add a newline. Also would be nice to explain
Michael K. (Yandex Team) 2017/02/17 13:38:48 Done.
+ int available;
+#endif
+
+#if defined(OS_LINUX) || defined(OS_ANDROID)
// 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
@@ -297,6 +304,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
int active_file;
int inactive_file;
int dirty;
+ int reclaimable;
// vmstats data.
unsigned long pswpin;
@@ -311,6 +319,12 @@ struct BASE_EXPORT SystemMemoryInfoKB {
int gem_objects;
long long gem_size;
#endif // defined(OS_CHROMEOS)
+
+#if defined(OS_MACOSX) || defined(OS_IOS)
+ int speculative;
+ int file_backed;
+ int purgeable;
+#endif
};
// On Linux/Android/Chrome OS, system-wide memory consumption data is parsed
« no previous file with comments | « no previous file | base/process/process_metrics_ios.cc » ('j') | base/process/process_metrics_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698