blob: fd49b30b1d1d301061057443c1a9b42ab7b48f02 [file] [log] [blame]
[email protected]c5dbef02011-05-13 05:06:091// Copyright (c) 2011 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
5#include "chrome/browser/memory_details.h"
initial.commit09911bf2008-07-26 23:55:296
7#include "base/file_version_info.h"
[email protected]835d7c82010-10-14 04:38:388#include "base/metrics/histogram.h"
[email protected]76543b92009-08-31 17:27:459#include "base/process_util.h"
[email protected]33b9df42010-07-29 06:46:3910#include "base/string_util.h"
[email protected]64048bd2010-03-08 23:28:5811#include "base/utf_string_conversions.h"
[email protected]8add5412011-10-01 21:02:1412#include "chrome/browser/extensions/extension_process_manager.h"
[email protected]79dc42cd2011-01-08 21:43:3513#include "chrome/browser/extensions/extension_service.h"
14#include "chrome/browser/profiles/profile.h"
[email protected]fcf79352010-12-28 20:13:2015#include "chrome/common/extensions/extension.h"
[email protected]cd3d7892009-03-04 23:55:0616#include "chrome/common/url_constants.h"
[email protected]ee162d82011-10-06 06:35:3717#include "chrome/common/chrome_view_types.h"
[email protected]a01efd22011-03-01 00:38:3218#include "content/browser/browser_child_process_host.h"
19#include "content/browser/browser_thread.h"
20#include "content/browser/renderer_host/backing_store_manager.h"
21#include "content/browser/renderer_host/render_process_host.h"
22#include "content/browser/renderer_host/render_view_host.h"
23#include "content/browser/tab_contents/navigation_entry.h"
24#include "content/browser/tab_contents/tab_contents.h"
[email protected]e091df82011-10-11 18:13:2125#include "content/public/common/bindings_policy.h"
[email protected]ae5ca892009-07-30 18:00:4726#include "grit/chromium_strings.h"
[email protected]4f260d02010-12-23 18:35:4227#include "grit/generated_resources.h"
[email protected]c051a1b2011-01-21 23:30:1728#include "ui/base/l10n/l10n_util.h"
initial.commit09911bf2008-07-26 23:55:2929
[email protected]1fd5302c2011-05-28 04:06:4330#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]a01efd22011-03-01 00:38:3231#include "content/browser/zygote_host_linux.h"
32#include "content/browser/renderer_host/render_sandbox_host_linux.h"
[email protected]54fd1d32009-09-01 00:12:5833#endif
initial.commit09911bf2008-07-26 23:55:2934
[email protected]8e383412010-10-19 16:57:0335ProcessMemoryInformation::ProcessMemoryInformation()
36 : pid(0),
37 num_processes(0),
38 is_diagnostics(false),
[email protected]fcf79352010-12-28 20:13:2039 type(ChildProcessInfo::UNKNOWN_PROCESS),
40 renderer_type(ChildProcessInfo::RENDERER_UNKNOWN) {
[email protected]8e383412010-10-19 16:57:0341}
42
43ProcessMemoryInformation::~ProcessMemoryInformation() {}
44
[email protected]93aa89c72010-10-20 21:32:0445ProcessData::ProcessData() {}
46
47ProcessData::ProcessData(const ProcessData& rhs)
48 : name(rhs.name),
49 process_name(rhs.process_name),
50 processes(rhs.processes) {
51}
52
53ProcessData::~ProcessData() {}
54
55ProcessData& ProcessData::operator=(const ProcessData& rhs) {
56 name = rhs.name;
57 process_name = rhs.process_name;
58 processes = rhs.processes;
59 return *this;
60}
61
initial.commit09911bf2008-07-26 23:55:2962// About threading:
63//
64// This operation will hit no fewer than 3 threads.
65//
[email protected]a436d922009-02-13 23:16:4266// The ChildProcessInfo::Iterator can only be accessed from the IO thread.
initial.commit09911bf2008-07-26 23:55:2967//
68// The RenderProcessHostIterator can only be accessed from the UI thread.
69//
70// This operation can take 30-100ms to complete. We never want to have
71// one task run for that long on the UI or IO threads. So, we run the
72// expensive parts of this operation over on the file thread.
73//
initial.commit09911bf2008-07-26 23:55:2974void MemoryDetails::StartFetch() {
[email protected]9bb480ee2011-08-03 21:41:1675 // This might get called from the UI or FILE threads, but should not be
76 // getting called from the IO thread.
[email protected]f8b3ef82010-10-11 02:45:5277 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
initial.commit09911bf2008-07-26 23:55:2978
79 // In order to process this request, we need to use the plugin information.
80 // However, plugin process information is only available from the IO thread.
[email protected]f8b3ef82010-10-11 02:45:5281 BrowserThread::PostTask(
82 BrowserThread::IO, FROM_HERE,
[email protected]a27a9382009-02-11 23:55:1083 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnIOThread));
initial.commit09911bf2008-07-26 23:55:2984}
85
[email protected]8e383412010-10-19 16:57:0386MemoryDetails::~MemoryDetails() {}
87
[email protected]a27a9382009-02-11 23:55:1088void MemoryDetails::CollectChildInfoOnIOThread() {
[email protected]f8b3ef82010-10-11 02:45:5289 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
initial.commit09911bf2008-07-26 23:55:2990
[email protected]a27a9382009-02-11 23:55:1091 std::vector<ProcessMemoryInformation> child_info;
92
[email protected]a436d922009-02-13 23:16:4293 // Collect the list of child processes.
[email protected]d27893f62010-07-03 05:47:4294 for (BrowserChildProcessHost::Iterator iter; !iter.Done(); ++iter) {
[email protected]a27a9382009-02-11 23:55:1095 ProcessMemoryInformation info;
[email protected]76543b92009-08-31 17:27:4596 info.pid = base::GetProcId(iter->handle());
[email protected]a27a9382009-02-11 23:55:1097 if (!info.pid)
98 continue;
99
[email protected]a436d922009-02-13 23:16:42100 info.type = iter->type();
[email protected]fcf79352010-12-28 20:13:20101 info.renderer_type = iter->renderer_type();
[email protected]68b9e72b2011-08-05 23:08:22102 info.titles.push_back(iter->name());
[email protected]a27a9382009-02-11 23:55:10103 child_info.push_back(info);
initial.commit09911bf2008-07-26 23:55:29104 }
105
106 // Now go do expensive memory lookups from the file thread.
[email protected]f8b3ef82010-10-11 02:45:52107 BrowserThread::PostTask(
108 BrowserThread::FILE, FROM_HERE,
[email protected]a27a9382009-02-11 23:55:10109 NewRunnableMethod(this, &MemoryDetails::CollectProcessData, child_info));
initial.commit09911bf2008-07-26 23:55:29110}
111
[email protected]a27a9382009-02-11 23:55:10112void MemoryDetails::CollectChildInfoOnUIThread() {
[email protected]f8b3ef82010-10-11 02:45:52113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
initial.commit09911bf2008-07-26 23:55:29114
[email protected]1fd5302c2011-05-28 04:06:43115#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]d3c6c0d72010-12-09 08:15:04116 const pid_t zygote_pid = ZygoteHost::GetInstance()->pid();
117 const pid_t sandbox_helper_pid = RenderSandboxHostLinux::GetInstance()->pid();
[email protected]54fd1d32009-09-01 00:12:58118#endif
119
120 ProcessData* const chrome_browser = ChromeBrowser();
[email protected]a27a9382009-02-11 23:55:10121 // Get more information about the process.
[email protected]54fd1d32009-09-01 00:12:58122 for (size_t index = 0; index < chrome_browser->processes.size();
initial.commit09911bf2008-07-26 23:55:29123 index++) {
[email protected]a27a9382009-02-11 23:55:10124 // Check if it's a renderer, if so get the list of page titles in it and
[email protected]fcf79352010-12-28 20:13:20125 // check if it's a diagnostics-related process. We skip about:memory pages.
126 // Iterate the RenderProcessHosts to find the tab contents.
[email protected]54fd1d32009-09-01 00:12:58127 ProcessMemoryInformation& process =
128 chrome_browser->processes[index];
129
[email protected]019191a2009-10-02 20:37:27130 for (RenderProcessHost::iterator renderer_iter(
131 RenderProcessHost::AllHostsIterator()); !renderer_iter.IsAtEnd();
132 renderer_iter.Advance()) {
[email protected]fcf79352010-12-28 20:13:20133 RenderProcessHost* render_process_host = renderer_iter.GetCurrentValue();
134 DCHECK(render_process_host);
[email protected]8a34e6602010-10-02 17:29:43135 // Ignore processes that don't have a connection, such as crashed tabs.
[email protected]fcf79352010-12-28 20:13:20136 if (!render_process_host->HasConnection() ||
137 process.pid != base::GetProcId(render_process_host->GetHandle())) {
[email protected]a27a9382009-02-11 23:55:10138 continue;
[email protected]201b2732009-11-13 18:57:46139 }
[email protected]a27a9382009-02-11 23:55:10140 process.type = ChildProcessInfo::RENDER_PROCESS;
[email protected]9b62ecf2011-07-27 20:23:08141 Profile* profile =
142 Profile::FromBrowserContext(render_process_host->browser_context());
[email protected]79dc42cd2011-01-08 21:43:35143 ExtensionService* extension_service = profile->GetExtensionService();
[email protected]8add5412011-10-01 21:02:14144 ExtensionProcessManager* extension_process_manager =
145 profile->GetExtensionProcessManager();
[email protected]79dc42cd2011-01-08 21:43:35146
[email protected]a27a9382009-02-11 23:55:10147 // The RenderProcessHost may host multiple TabContents. Any
148 // of them which contain diagnostics information make the whole
149 // process be considered a diagnostics process.
150 //
151 // NOTE: This is a bit dangerous. We know that for now, listeners
152 // are always RenderWidgetHosts. But in theory, they don't
153 // have to be.
[email protected]9de09f82009-08-17 20:13:53154 RenderProcessHost::listeners_iterator iter(
[email protected]fcf79352010-12-28 20:13:20155 render_process_host->ListenersIterator());
[email protected]9de09f82009-08-17 20:13:53156 for (; !iter.IsAtEnd(); iter.Advance()) {
157 const RenderWidgetHost* widget =
158 static_cast<const RenderWidgetHost*>(iter.GetCurrentValue());
[email protected]a27a9382009-02-11 23:55:10159 DCHECK(widget);
160 if (!widget || !widget->IsRenderView())
161 continue;
initial.commit09911bf2008-07-26 23:55:29162
[email protected]9de09f82009-08-17 20:13:53163 const RenderViewHost* host = static_cast<const RenderViewHost*>(widget);
[email protected]fcf79352010-12-28 20:13:20164 RenderViewHostDelegate* host_delegate = host->delegate();
[email protected]4e6ffde2011-03-11 00:59:27165 DCHECK(host_delegate);
[email protected]fcf79352010-12-28 20:13:20166 GURL url = host_delegate->GetURL();
[email protected]ee162d82011-10-06 06:35:37167 content::ViewType::Type type = host_delegate->GetRenderViewType();
[email protected]e091df82011-10-11 18:13:21168 if (host->enabled_bindings() & content::BINDINGS_POLICY_WEB_UI) {
[email protected]fcf79352010-12-28 20:13:20169 // TODO(erikkay) the type for devtools doesn't actually appear to
170 // be set.
[email protected]ee162d82011-10-06 06:35:37171 if (type == content::ViewType::DEV_TOOLS_UI)
[email protected]fcf79352010-12-28 20:13:20172 process.renderer_type = ChildProcessInfo::RENDERER_DEVTOOLS;
173 else
174 process.renderer_type = ChildProcessInfo::RENDERER_CHROME;
[email protected]8add5412011-10-01 21:02:14175 } else if (extension_process_manager->AreBindingsEnabledForProcess(
176 host->process()->id())) {
[email protected]fcf79352010-12-28 20:13:20177 process.renderer_type = ChildProcessInfo::RENDERER_EXTENSION;
178 }
[email protected]4e6ffde2011-03-11 00:59:27179 TabContents* contents = host_delegate->GetAsTabContents();
[email protected]fcf79352010-12-28 20:13:20180 if (!contents) {
[email protected]718eab62011-10-05 21:16:52181 if (extension_process_manager->IsExtensionProcess(
182 host->process()->id())) {
[email protected]79dc42cd2011-01-08 21:43:35183 const Extension* extension =
184 extension_service->GetExtensionByURL(url);
185 if (extension) {
186 string16 title = UTF8ToUTF16(extension->name());
187 process.titles.push_back(title);
188 }
[email protected]fcf79352010-12-28 20:13:20189 } else if (process.renderer_type ==
190 ChildProcessInfo::RENDERER_UNKNOWN) {
191 process.titles.push_back(UTF8ToUTF16(url.spec()));
192 switch (type) {
[email protected]ee162d82011-10-06 06:35:37193 case chrome::ViewType::BACKGROUND_CONTENTS:
[email protected]fcf79352010-12-28 20:13:20194 process.renderer_type =
195 ChildProcessInfo::RENDERER_BACKGROUND_APP;
196 break;
[email protected]ee162d82011-10-06 06:35:37197 case content::ViewType::INTERSTITIAL_PAGE:
[email protected]fcf79352010-12-28 20:13:20198 process.renderer_type = ChildProcessInfo::RENDERER_INTERSTITIAL;
199 break;
[email protected]ee162d82011-10-06 06:35:37200 case chrome::ViewType::NOTIFICATION:
[email protected]fcf79352010-12-28 20:13:20201 process.renderer_type = ChildProcessInfo::RENDERER_NOTIFICATION;
202 break;
203 default:
204 process.renderer_type = ChildProcessInfo::RENDERER_UNKNOWN;
205 break;
206 }
207 }
[email protected]a27a9382009-02-11 23:55:10208 continue;
[email protected]fcf79352010-12-28 20:13:20209 }
210
211 // Since We have a TabContents and and the renderer type hasn't been
212 // set yet, it must be a normal tabbed renderer.
213 if (process.renderer_type == ChildProcessInfo::RENDERER_UNKNOWN)
214 process.renderer_type = ChildProcessInfo::RENDERER_NORMAL;
215
[email protected]4f260d02010-12-23 18:35:42216 string16 title = contents->GetTitle();
[email protected]a27a9382009-02-11 23:55:10217 if (!title.length())
[email protected]4f260d02010-12-23 18:35:42218 title = l10n_util::GetStringUTF16(IDS_DEFAULT_TAB_TITLE);
[email protected]a27a9382009-02-11 23:55:10219 process.titles.push_back(title);
[email protected]cd3d7892009-03-04 23:55:06220
[email protected]ebe89e062009-08-13 23:16:54221 // We need to check the pending entry as well as the virtual_url to
[email protected]37ae3f22011-07-12 03:56:14222 // see if it's a chrome://memory URL (we don't want to count these in
223 // the total memory usage of the browser).
[email protected]cd3d7892009-03-04 23:55:06224 //
[email protected]37ae3f22011-07-12 03:56:14225 // When we reach here, chrome://memory will be the pending entry since
226 // we haven't responded with any data such that it would be committed.
227 // If you have another chrome://memory tab open (which would be
228 // committed), we don't want to count it either, so we also check the
229 // last committed entry.
[email protected]cd3d7892009-03-04 23:55:06230 //
231 // Either the pending or last committed entries can be NULL.
[email protected]6df40742009-03-19 22:24:50232 const NavigationEntry* pending_entry =
[email protected]ce3fa3c2009-04-20 19:55:57233 contents->controller().pending_entry();
[email protected]cd3d7892009-03-04 23:55:06234 const NavigationEntry* last_committed_entry =
[email protected]ce3fa3c2009-04-20 19:55:57235 contents->controller().GetLastCommittedEntry();
[email protected]cd3d7892009-03-04 23:55:06236 if ((last_committed_entry &&
[email protected]ebe89e062009-08-13 23:16:54237 LowerCaseEqualsASCII(last_committed_entry->virtual_url().spec(),
[email protected]37ae3f22011-07-12 03:56:14238 chrome::kChromeUIMemoryURL)) ||
[email protected]cd3d7892009-03-04 23:55:06239 (pending_entry &&
[email protected]ebe89e062009-08-13 23:16:54240 LowerCaseEqualsASCII(pending_entry->virtual_url().spec(),
[email protected]37ae3f22011-07-12 03:56:14241 chrome::kChromeUIMemoryURL)))
[email protected]a27a9382009-02-11 23:55:10242 process.is_diagnostics = true;
initial.commit09911bf2008-07-26 23:55:29243 }
244 }
[email protected]54fd1d32009-09-01 00:12:58245
[email protected]1fd5302c2011-05-28 04:06:43246#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]54fd1d32009-09-01 00:12:58247 if (process.pid == zygote_pid) {
248 process.type = ChildProcessInfo::ZYGOTE_PROCESS;
249 } else if (process.pid == sandbox_helper_pid) {
250 process.type = ChildProcessInfo::SANDBOX_HELPER_PROCESS;
251 }
252#endif
initial.commit09911bf2008-07-26 23:55:29253 }
254
[email protected]a27a9382009-02-11 23:55:10255 // Get rid of other Chrome processes that are from a different profile.
[email protected]54fd1d32009-09-01 00:12:58256 for (size_t index = 0; index < chrome_browser->processes.size();
[email protected]a27a9382009-02-11 23:55:10257 index++) {
[email protected]54fd1d32009-09-01 00:12:58258 if (chrome_browser->processes[index].type ==
[email protected]a27a9382009-02-11 23:55:10259 ChildProcessInfo::UNKNOWN_PROCESS) {
[email protected]54fd1d32009-09-01 00:12:58260 chrome_browser->processes.erase(
261 chrome_browser->processes.begin() + index);
[email protected]a436d922009-02-13 23:16:42262 index--;
[email protected]a27a9382009-02-11 23:55:10263 }
264 }
265
initial.commit09911bf2008-07-26 23:55:29266 UpdateHistograms();
267
268 OnDetailsAvailable();
269}
270
271void MemoryDetails::UpdateHistograms() {
272 // Reports a set of memory metrics to UMA.
[email protected]57c4b852009-08-17 21:59:29273 // Memory is measured in KB.
initial.commit09911bf2008-07-26 23:55:29274
[email protected]54fd1d32009-09-01 00:12:58275 const ProcessData& browser = *ChromeBrowser();
initial.commit09911bf2008-07-26 23:55:29276 size_t aggregate_memory = 0;
[email protected]fcf79352010-12-28 20:13:20277 int chrome_count = 0;
278 int extension_count = 0;
[email protected]a27a9382009-02-11 23:55:10279 int plugin_count = 0;
[email protected]eef348fb2011-08-01 21:11:08280 int pepper_plugin_count = 0;
[email protected]fcf79352010-12-28 20:13:20281 int renderer_count = 0;
282 int other_count = 0;
[email protected]a27a9382009-02-11 23:55:10283 int worker_count = 0;
initial.commit09911bf2008-07-26 23:55:29284 for (size_t index = 0; index < browser.processes.size(); index++) {
[email protected]921cd0cc2008-10-21 22:30:55285 int sample = static_cast<int>(browser.processes[index].working_set.priv);
286 aggregate_memory += sample;
[email protected]a27a9382009-02-11 23:55:10287 switch (browser.processes[index].type) {
[email protected]f164cea2009-11-05 23:37:40288 case ChildProcessInfo::BROWSER_PROCESS:
289 UMA_HISTOGRAM_MEMORY_KB("Memory.Browser", sample);
290 break;
[email protected]fcf79352010-12-28 20:13:20291 case ChildProcessInfo::RENDER_PROCESS: {
292 ChildProcessInfo::RendererProcessType renderer_type =
293 browser.processes[index].renderer_type;
294 switch (renderer_type) {
295 case ChildProcessInfo::RENDERER_EXTENSION:
296 UMA_HISTOGRAM_MEMORY_KB("Memory.Extension", sample);
297 extension_count++;
298 break;
299 case ChildProcessInfo::RENDERER_CHROME:
300 UMA_HISTOGRAM_MEMORY_KB("Memory.Chrome", sample);
301 chrome_count++;
302 break;
303 case ChildProcessInfo::RENDERER_UNKNOWN:
304 NOTREACHED() << "Unknown renderer process type.";
305 break;
306 case ChildProcessInfo::RENDERER_NORMAL:
307 default:
308 // TODO(erikkay): Should we bother splitting out the other subtypes?
309 UMA_HISTOGRAM_MEMORY_KB("Memory.Renderer", sample);
310 renderer_count++;
311 break;
312 }
[email protected]f164cea2009-11-05 23:37:40313 break;
[email protected]fcf79352010-12-28 20:13:20314 }
[email protected]f164cea2009-11-05 23:37:40315 case ChildProcessInfo::PLUGIN_PROCESS:
316 UMA_HISTOGRAM_MEMORY_KB("Memory.Plugin", sample);
317 plugin_count++;
318 break;
319 case ChildProcessInfo::WORKER_PROCESS:
320 UMA_HISTOGRAM_MEMORY_KB("Memory.Worker", sample);
321 worker_count++;
322 break;
323 case ChildProcessInfo::UTILITY_PROCESS:
324 UMA_HISTOGRAM_MEMORY_KB("Memory.Utility", sample);
[email protected]fcf79352010-12-28 20:13:20325 other_count++;
[email protected]f164cea2009-11-05 23:37:40326 break;
327 case ChildProcessInfo::ZYGOTE_PROCESS:
328 UMA_HISTOGRAM_MEMORY_KB("Memory.Zygote", sample);
[email protected]fcf79352010-12-28 20:13:20329 other_count++;
[email protected]f164cea2009-11-05 23:37:40330 break;
331 case ChildProcessInfo::SANDBOX_HELPER_PROCESS:
332 UMA_HISTOGRAM_MEMORY_KB("Memory.SandboxHelper", sample);
[email protected]fcf79352010-12-28 20:13:20333 other_count++;
[email protected]f164cea2009-11-05 23:37:40334 break;
[email protected]103607e2010-02-01 18:57:09335 case ChildProcessInfo::NACL_LOADER_PROCESS:
[email protected]f164cea2009-11-05 23:37:40336 UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClient", sample);
[email protected]fcf79352010-12-28 20:13:20337 other_count++;
[email protected]f164cea2009-11-05 23:37:40338 break;
[email protected]aef8d5ae2010-03-17 22:40:52339 case ChildProcessInfo::NACL_BROKER_PROCESS:
340 UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClientBroker", sample);
[email protected]fcf79352010-12-28 20:13:20341 other_count++;
[email protected]aef8d5ae2010-03-17 22:40:52342 break;
[email protected]96fcbf2d2010-08-03 16:10:27343 case ChildProcessInfo::GPU_PROCESS:
344 UMA_HISTOGRAM_MEMORY_KB("Memory.Gpu", sample);
[email protected]fcf79352010-12-28 20:13:20345 other_count++;
[email protected]96fcbf2d2010-08-03 16:10:27346 break;
[email protected]eef348fb2011-08-01 21:11:08347 case ChildProcessInfo::PPAPI_PLUGIN_PROCESS:
348 UMA_HISTOGRAM_MEMORY_KB("Memory.PepperPlugin", sample);
349 pepper_plugin_count++;
350 break;
[email protected]f164cea2009-11-05 23:37:40351 default:
352 NOTREACHED();
[email protected]eef348fb2011-08-01 21:11:08353 break;
initial.commit09911bf2008-07-26 23:55:29354 }
355 }
[email protected]57c4b852009-08-17 21:59:29356 UMA_HISTOGRAM_MEMORY_KB("Memory.BackingStore",
357 BackingStoreManager::MemorySize() / 1024);
[email protected]a27a9382009-02-11 23:55:10358
[email protected]553dba62009-02-24 19:08:23359 UMA_HISTOGRAM_COUNTS_100("Memory.ProcessCount",
initial.commit09911bf2008-07-26 23:55:29360 static_cast<int>(browser.processes.size()));
[email protected]fcf79352010-12-28 20:13:20361 UMA_HISTOGRAM_COUNTS_100("Memory.ChromeProcessCount", chrome_count);
362 UMA_HISTOGRAM_COUNTS_100("Memory.ExtensionProcessCount", extension_count);
363 UMA_HISTOGRAM_COUNTS_100("Memory.OtherProcessCount", other_count);
[email protected]553dba62009-02-24 19:08:23364 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count);
[email protected]eef348fb2011-08-01 21:11:08365 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount",
366 pepper_plugin_count);
[email protected]fcf79352010-12-28 20:13:20367 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count);
[email protected]553dba62009-02-24 19:08:23368 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count);
[email protected]f164cea2009-11-05 23:37:40369 // TODO(viettrungluu): Do we want separate counts for the other
370 // (platform-specific) process types?
[email protected]921cd0cc2008-10-21 22:30:55371
372 int total_sample = static_cast<int>(aggregate_memory / 1000);
[email protected]553dba62009-02-24 19:08:23373 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample);
initial.commit09911bf2008-07-26 23:55:29374}