diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 18:10:04 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 18:10:04 +0000 |
commit | f37661dddf78ca24d46a7871b8e292488c76451f (patch) | |
tree | 252fe1c3a154f3e0724ed3c76c8404364e869938 /base/process_util.h | |
parent | afd6c510e8e1e382c05bbed1581c5d99b3f26796 (diff) | |
download | chromium_src-f37661dddf78ca24d46a7871b8e292488c76451f.zip chromium_src-f37661dddf78ca24d46a7871b8e292488c76451f.tar.gz chromium_src-f37661dddf78ca24d46a7871b8e292488c76451f.tar.bz2 |
CrOS - Memory debug widget shows anonymous memory and renderer kills.
Change the status area memory widget to display anonymous memory allocated,
which is a good proxy for "total memory allocated" and what we use in the
UMA histograms (Platform.MemuseAnon[0-5]). Also display renderer kills, which
will tick up when we run out of memory and the OOM killer starts running.
Refactor GetSystemMemoryInfo to use a struct.
BUG=chromium-os:18969
TEST=manual, turn on memory status widget in about:flags and restart, open some tabs and watch memory consumption increase, use Task Manager / End Process to kill a process and watch the kill count increase
Review URL: http://codereview.chromium.org/7607035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r-- | base/process_util.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/base/process_util.h b/base/process_util.h index acaa2d7..b98e266 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -657,11 +657,23 @@ class BASE_EXPORT ProcessMetrics { }; #if defined(OS_LINUX) +// Data from /proc/meminfo about system-wide memory consumption. +// Values are in KB. +struct SystemMemoryInfoKB { + SystemMemoryInfoKB() : total(0), free(0), buffers(0), cached(0), + active_anon(0), inactive_anon(0), shmem(0) {} + int total; + int free; + int buffers; + int cached; + int active_anon; + int inactive_anon; + int shmem; +}; // Retrieves data from /proc/meminfo about system-wide memory consumption. -// Values are in KB. Returns true on success. -BASE_EXPORT bool GetSystemMemoryInfo(int* total_kb, int* free_kb, - int* buffers_kb, int* cache_kb, - int* shmem_kb); +// Fills in the provided |meminfo| structure. Returns true on success. +// Exposed for memory debugging widget. +BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo); #endif // Returns the memory committed by the system in KBytes. |