summaryrefslogtreecommitdiffstats
path: root/chrome/browser/process_info_snapshot.h
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-04 16:17:13 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-04 16:17:13 +0000
commit983ef7fa2d5b27f1fa5b8d338ffde33fe24d72f3 (patch)
tree2fe6bde0f39073108f4ce1d152d130eb92d58b38 /chrome/browser/process_info_snapshot.h
parent6ce8ba65f2767fcabec600bf4c0022e0022c16cb (diff)
downloadchromium_src-983ef7fa2d5b27f1fa5b8d338ffde33fe24d72f3.zip
chromium_src-983ef7fa2d5b27f1fa5b8d338ffde33fe24d72f3.tar.gz
chromium_src-983ef7fa2d5b27f1fa5b8d338ffde33fe24d72f3.tar.bz2
Mac: stop zombie ps processes from being created.
This fixes two bugs: - the output buffer for the ps command being run could be too small (fix: buffer enlargened); and - if the output buffer was too small, waitpid() wouldn't be called (fix: always call waitpid(), obviously). BUG=31378 TEST=On a big, long-running Chrome/Chromium (with many processes, e.g., renderers), check that there are no zombie ps processes (with PPID the browser process); looking at about:memory may help speed up the creation of such zombies. Also, run the new test, ProcessUtilTest.GetAppOutputRestrictedNoZombies. Review URL: http://codereview.chromium.org/523033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_info_snapshot.h')
-rw-r--r--chrome/browser/process_info_snapshot.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/process_info_snapshot.h b/chrome/browser/process_info_snapshot.h
index 88064c6..14e8ceb 100644
--- a/chrome/browser/process_info_snapshot.h
+++ b/chrome/browser/process_info_snapshot.h
@@ -31,9 +31,14 @@ class ProcessInfoSnapshot {
ProcessInfoSnapshot();
~ProcessInfoSnapshot();
+ // Maximum size of lists of PIDs which this class will accept; used in
+ // |Sample()| below.
+ static const size_t kMaxPidListSize;
+
// Capture a snapshot of process memory information (by running ps) for the
// given list of PIDs. Call only from the file thread.
- // |pid_list| - list of |ProcessId|s on which to capture information.
+ // |pid_list| - list of |ProcessId|s on which to capture information; must
+ // have no more than |kMaxPidListSize| (above) entries,
// returns - |true| if okay, |false| on error.
bool Sample(std::vector<base::ProcessId> pid_list);