summaryrefslogtreecommitdiffstats
path: root/base/process_util.h
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 17:46:08 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 17:46:08 +0000
commit98947a0beaa29f997e77e010cfaec72666e045e2 (patch)
tree7ed453cb5d337cf6d83208a16a95d0e1394be0b2 /base/process_util.h
parente2327e1c76276b05492c4d7909432d323c7fdb55 (diff)
downloadchromium_src-98947a0beaa29f997e77e010cfaec72666e045e2.zip
chromium_src-98947a0beaa29f997e77e010cfaec72666e045e2.tar.gz
chromium_src-98947a0beaa29f997e77e010cfaec72666e045e2.tar.bz2
Speed up the Task Manager on linux.
- Unify the calls to get shared memory and private memory. On Linux, these call the same API and on Linux, it takes >10ms to fetch both values each time it is called. - Cache the returned memory values. While sorting the task manager by memory, it would make the expensive memory call for each row on each sort operation. BUG=40033 TEST=Existing task manager tests. Review URL: http://codereview.chromium.org/2047009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r--base/process_util.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/base/process_util.h b/base/process_util.h
index ec3510a..b8bcfd4 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -481,10 +481,12 @@ class ProcessMetrics {
size_t GetWorkingSetSize() const;
// Returns the peak working set size, in bytes.
size_t GetPeakWorkingSetSize() const;
- // Returns private usage, in bytes. Private bytes is the amount
- // of memory currently allocated to a process that cannot be shared.
- // Note: returns 0 on unsupported OSes: prior to XP SP2.
- size_t GetPrivateBytes() const;
+ // Returns private and sharedusage, in bytes. Private bytes is the amount of
+ // memory currently allocated to a process that cannot be shared. Returns
+ // false on platform specific error conditions. Note: |private_bytes|
+ // returns 0 on unsupported OSes: prior to XP SP2.
+ bool GetMemoryBytes(size_t* private_bytes,
+ size_t* shared_bytes);
// Fills a CommittedKBytes with both resident and paged
// memory usage as per definition of CommittedBytes.
void GetCommittedKBytes(CommittedKBytes* usage) const;