Chromium Code Reviews| Index: base/process/process_metrics.h |
| diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h |
| index 2448a715ace9b5eade7f09524561ffcedb666cc3..8e137db2f840bcf00e45770286d55158a0f05b4c 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); |
| @@ -274,13 +275,29 @@ struct BASE_EXPORT SystemMemoryInfoKB { |
| std::unique_ptr<Value> ToValue() const; |
| int total; |
| + // Note: on Windows this field also includes "zero" memory. |
| + // See "Memory Management" and "Memory Performance Information" |
| + // articles at MSDN. |
| int free; |
|
brucedawson
2017/03/09 19:17:51
What is this actually used for? The purpose of the
Michael K. (Yandex Team)
2017/03/10 15:53:57
It was used in first patchsets but wasn't used in
|
| -#if defined(OS_LINUX) |
| +#if defined(OS_WIN) |
| + // "This is the amount of physical memory that can be immediately reused |
| + // without having to write its contents to disk first. It is the sum of the |
| + // size of the standby, free, and zero lists." (MSDN). |
| + // Standby: not modified pages of physical ram (file-backed memory) that are |
| + // not actively being used. |
| + // Note: on Windows this field has a bit different meaning from the Linux one |
| + // (see below). |
| + 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 |
| // be 0 in earlier kernel versions. |
| + // Note: on Linux "available" includes _all_ file-backed memory |
| + // (active + inactive). It is different from the Windows one (see above). |
| int available; |
| #endif |
| @@ -297,6 +314,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { |
| int active_file; |
| int inactive_file; |
| int dirty; |
| + int reclaimable; |
| // vmstats data. |
| unsigned long pswpin; |
| @@ -311,6 +329,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 |