blob: e228faa535395137c9afcec8f2e70dfd84edfd92 [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]a01efd22011-03-01 00:38:3217#include "content/browser/browser_child_process_host.h"
18#include "content/browser/browser_thread.h"
19#include "content/browser/renderer_host/backing_store_manager.h"
20#include "content/browser/renderer_host/render_process_host.h"
21#include "content/browser/renderer_host/render_view_host.h"
22#include "content/browser/tab_contents/navigation_entry.h"
23#include "content/browser/tab_contents/tab_contents.h"
[email protected]9966325b2011-04-18 05:00:1024#include "content/common/bindings_policy.h"
[email protected]ae5ca892009-07-30 18:00:4725#include "grit/chromium_strings.h"
[email protected]4f260d02010-12-23 18:35:4226#include "grit/generated_resources.h"
[email protected]c051a1b2011-01-21 23:30:1727#include "ui/base/l10n/l10n_util.h"
initial.commit09911bf2008-07-26 23:55:2928
[email protected]1fd5302c2011-05-28 04:06:4329#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]a01efd22011-03-01 00:38:3230#include "content/browser/zygote_host_linux.h"
31#include "content/browser/renderer_host/render_sandbox_host_linux.h"
[email protected]54fd1d32009-09-01 00:12:5832#endif
initial.commit09911bf2008-07-26 23:55:2933
[email protected]8e383412010-10-19 16:57:0334ProcessMemoryInformation::ProcessMemoryInformation()
35 : pid(0),
36 num_processes(0),
37 is_diagnostics(false),
[email protected]fcf79352010-12-28 20:13:2038 type(ChildProcessInfo::UNKNOWN_PROCESS),
39 renderer_type(ChildProcessInfo::RENDERER_UNKNOWN) {
[email protected]8e383412010-10-19 16:57:0340}
41
42ProcessMemoryInformation::~ProcessMemoryInformation() {}
43
[email protected]93aa89c72010-10-20 21:32:0444ProcessData::ProcessData() {}
45
46ProcessData::ProcessData(const ProcessData& rhs)
47 : name(rhs.name),
48 process_name(rhs.process_name),
49 processes(rhs.processes) {
50}
51
52ProcessData::~ProcessData() {}
53
54ProcessData& ProcessData::operator=(const ProcessData& rhs) {
55 name = rhs.name;
56 process_name = rhs.process_name;
57 processes = rhs.processes;
58 return *this;
59}
60
initial.commit09911bf2008-07-26 23:55:2961// About threading:
62//
63// This operation will hit no fewer than 3 threads.
64//
[email protected]a436d922009-02-13 23:16:4265// The ChildProcessInfo::Iterator can only be accessed from the IO thread.
initial.commit09911bf2008-07-26 23:55:2966//
67// The RenderProcessHostIterator can only be accessed from the UI thread.
68//
69// This operation can take 30-100ms to complete. We never want to have
70// one task run for that long on the UI or IO threads. So, we run the
71// expensive parts of this operation over on the file thread.
72//
initial.commit09911bf2008-07-26 23:55:2973void MemoryDetails::StartFetch() {
[email protected]9bb480ee2011-08-03 21:41:1674 // This might get called from the UI or FILE threads, but should not be
75 // getting called from the IO thread.
[email protected]f8b3ef82010-10-11 02:45:5276 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
initial.commit09911bf2008-07-26 23:55:2977
78 // In order to process this request, we need to use the plugin information.
79 // However, plugin process information is only available from the IO thread.
[email protected]f8b3ef82010-10-11 02:45:5280 BrowserThread::PostTask(
81 BrowserThread::IO, FROM_HERE,
[email protected]a27a9382009-02-11 23:55:1082 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnIOThread));
initial.commit09911bf2008-07-26 23:55:2983}
84
[email protected]8e383412010-10-19 16:57:0385MemoryDetails::~MemoryDetails() {}
86
[email protected]a27a9382009-02-11 23:55:1087void MemoryDetails::CollectChildInfoOnIOThread() {
[email protected]f8b3ef82010-10-11 02:45:5288 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
initial.commit09911bf2008-07-26 23:55:2989
[email protected]a27a9382009-02-11 23:55:1090 std::vector<ProcessMemoryInformation> child_info;
91
[email protected]a436d922009-02-13 23:16:4292 // Collect the list of child processes.
[email protected]d27893f62010-07-03 05:47:4293 for (BrowserChildProcessHost::Iterator iter; !iter.Done(); ++iter) {
[email protected]a27a9382009-02-11 23:55:1094 ProcessMemoryInformation info;
[email protected]76543b92009-08-31 17:27:4595 info.pid = base::GetProcId(iter->handle());
[email protected]a27a9382009-02-11 23:55:1096 if (!info.pid)
97 continue;
98
[email protected]a436d922009-02-13 23:16:4299 info.type = iter->type();
[email protected]fcf79352010-12-28 20:13:20100 info.renderer_type = iter->renderer_type();
[email protected]68b9e72b2011-08-05 23:08:22101 info.titles.push_back(iter->name());
[email protected]a27a9382009-02-11 23:55:10102 child_info.push_back(info);
initial.commit09911bf2008-07-26 23:55:29103 }
104
105 // Now go do expensive memory lookups from the file thread.
[email protected]f8b3ef82010-10-11 02:45:52106 BrowserThread::PostTask(
107 BrowserThread::FILE, FROM_HERE,
[email protected]a27a9382009-02-11 23:55:10108 NewRunnableMethod(this, &MemoryDetails::CollectProcessData, child_info));
initial.commit09911bf2008-07-26 23:55:29109}
110
[email protected]a27a9382009-02-11 23:55:10111void MemoryDetails::CollectChildInfoOnUIThread() {
[email protected]f8b3ef82010-10-11 02:45:52112 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
initial.commit09911bf2008-07-26 23:55:29113
[email protected]1fd5302c2011-05-28 04:06:43114#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]d3c6c0d72010-12-09 08:15:04115 const pid_t zygote_pid = ZygoteHost::GetInstance()->pid();
116 const pid_t sandbox_helper_pid = RenderSandboxHostLinux::GetInstance()->pid();
[email protected]54fd1d32009-09-01 00:12:58117#endif
118
119 ProcessData* const chrome_browser = ChromeBrowser();
[email protected]a27a9382009-02-11 23:55:10120 // Get more information about the process.
[email protected]54fd1d32009-09-01 00:12:58121 for (size_t index = 0; index < chrome_browser->processes.size();
initial.commit09911bf2008-07-26 23:55:29122 index++) {
[email protected]a27a9382009-02-11 23:55:10123 // Check if it's a renderer, if so get the list of page titles in it and
[email protected]fcf79352010-12-28 20:13:20124 // check if it's a diagnostics-related process. We skip about:memory pages.
125 // Iterate the RenderProcessHosts to find the tab contents.
[email protected]54fd1d32009-09-01 00:12:58126 ProcessMemoryInformation& process =
127 chrome_browser->processes[index];
128
[email protected]019191a2009-10-02 20:37:27129 for (RenderProcessHost::iterator renderer_iter(
130 RenderProcessHost::AllHostsIterator()); !renderer_iter.IsAtEnd();
131 renderer_iter.Advance()) {
[email protected]fcf79352010-12-28 20:13:20132 RenderProcessHost* render_process_host = renderer_iter.GetCurrentValue();
133 DCHECK(render_process_host);
[email protected]8a34e6602010-10-02 17:29:43134 // Ignore processes that don't have a connection, such as crashed tabs.
[email protected]fcf79352010-12-28 20:13:20135 if (!render_process_host->HasConnection() ||
136 process.pid != base::GetProcId(render_process_host->GetHandle())) {
[email protected]a27a9382009-02-11 23:55:10137 continue;
[email protected]201b2732009-11-13 18:57:46138 }
[email protected]a27a9382009-02-11 23:55:10139 process.type = ChildProcessInfo::RENDER_PROCESS;
[email protected]9b62ecf2011-07-27 20:23:08140 Profile* profile =
141 Profile::FromBrowserContext(render_process_host->browser_context());
[email protected]79dc42cd2011-01-08 21:43:35142 ExtensionService* extension_service = profile->GetExtensionService();
[email protected]8add5412011-10-01 21:02:14143 ExtensionProcessManager* extension_process_manager =
144 profile->GetExtensionProcessManager();
[email protected]79dc42cd2011-01-08 21:43:35145
[email protected]a27a9382009-02-11 23:55:10146 // The RenderProcessHost may host multiple TabContents. Any
147 // of them which contain diagnostics information make the whole
148 // process be considered a diagnostics process.
149 //
150 // NOTE: This is a bit dangerous. We know that for now, listeners
151 // are always RenderWidgetHosts. But in theory, they don't
152 // have to be.
[email protected]9de09f82009-08-17 20:13:53153 RenderProcessHost::listeners_iterator iter(
[email protected]fcf79352010-12-28 20:13:20154 render_process_host->ListenersIterator());
[email protected]9de09f82009-08-17 20:13:53155 for (; !iter.IsAtEnd(); iter.Advance()) {
156 const RenderWidgetHost* widget =
157 static_cast<const RenderWidgetHost*>(iter.GetCurrentValue());
[email protected]a27a9382009-02-11 23:55:10158 DCHECK(widget);
159 if (!widget || !widget->IsRenderView())
160 continue;
initial.commit09911bf2008-07-26 23:55:29161
[email protected]9de09f82009-08-17 20:13:53162 const RenderViewHost* host = static_cast<const RenderViewHost*>(widget);
[email protected]fcf79352010-12-28 20:13:20163 RenderViewHostDelegate* host_delegate = host->delegate();
[email protected]4e6ffde2011-03-11 00:59:27164 DCHECK(host_delegate);
[email protected]fcf79352010-12-28 20:13:20165 GURL url = host_delegate->GetURL();
166 ViewType::Type type = host_delegate->GetRenderViewType();
[email protected]c09163a2011-02-15 00:05:55167 if (host->enabled_bindings() & BindingsPolicy::WEB_UI) {
[email protected]fcf79352010-12-28 20:13:20168 // TODO(erikkay) the type for devtools doesn't actually appear to
169 // be set.
170 if (type == ViewType::DEV_TOOLS_UI)
171 process.renderer_type = ChildProcessInfo::RENDERER_DEVTOOLS;
172 else
173 process.renderer_type = ChildProcessInfo::RENDERER_CHROME;
[email protected]8add5412011-10-01 21:02:14174 } else if (extension_process_manager->AreBindingsEnabledForProcess(
175 host->process()->id())) {
[email protected]fcf79352010-12-28 20:13:20176 process.renderer_type = ChildProcessInfo::RENDERER_EXTENSION;
177 }
[email protected]4e6ffde2011-03-11 00:59:27178 TabContents* contents = host_delegate->GetAsTabContents();
[email protected]fcf79352010-12-28 20:13:20179 if (!contents) {
[email protected]718eab62011-10-05 21:16:52180 if (extension_process_manager->IsExtensionProcess(
181 host->process()->id())) {
[email protected]79dc42cd2011-01-08 21:43:35182 const Extension* extension =
183 extension_service->GetExtensionByURL(url);
184 if (extension) {
185 string16 title = UTF8ToUTF16(extension->name());
186 process.titles.push_back(title);
187 }
[email protected]fcf79352010-12-28 20:13:20188 } else if (process.renderer_type ==
189 ChildProcessInfo::RENDERER_UNKNOWN) {
190 process.titles.push_back(UTF8ToUTF16(url.spec()));
191 switch (type) {
192 case ViewType::BACKGROUND_CONTENTS:
193 process.renderer_type =
194 ChildProcessInfo::RENDERER_BACKGROUND_APP;
195 break;
196 case ViewType::INTERSTITIAL_PAGE:
197 process.renderer_type = ChildProcessInfo::RENDERER_INTERSTITIAL;
198 break;
199 case ViewType::NOTIFICATION:
200 process.renderer_type = ChildProcessInfo::RENDERER_NOTIFICATION;
201 break;
202 default:
203 process.renderer_type = ChildProcessInfo::RENDERER_UNKNOWN;
204 break;
205 }
206 }
[email protected]a27a9382009-02-11 23:55:10207 continue;
[email protected]fcf79352010-12-28 20:13:20208 }
209
210 // Since We have a TabContents and and the renderer type hasn't been
211 // set yet, it must be a normal tabbed renderer.
212 if (process.renderer_type == ChildProcessInfo::RENDERER_UNKNOWN)
213 process.renderer_type = ChildProcessInfo::RENDERER_NORMAL;
214
[email protected]4f260d02010-12-23 18:35:42215 string16 title = contents->GetTitle();
[email protected]a27a9382009-02-11 23:55:10216 if (!title.length())
[email protected]4f260d02010-12-23 18:35:42217 title = l10n_util::GetStringUTF16(IDS_DEFAULT_TAB_TITLE);
[email protected]a27a9382009-02-11 23:55:10218 process.titles.push_back(title);
[email protected]cd3d7892009-03-04 23:55:06219
[email protected]ebe89e062009-08-13 23:16:54220 // We need to check the pending entry as well as the virtual_url to
[email protected]37ae3f22011-07-12 03:56:14221 // see if it's a chrome://memory URL (we don't want to count these in
222 // the total memory usage of the browser).
[email protected]cd3d7892009-03-04 23:55:06223 //
[email protected]37ae3f22011-07-12 03:56:14224 // When we reach here, chrome://memory will be the pending entry since
225 // we haven't responded with any data such that it would be committed.
226 // If you have another chrome://memory tab open (which would be
227 // committed), we don't want to count it either, so we also check the
228 // last committed entry.
[email protected]cd3d7892009-03-04 23:55:06229 //
230 // Either the pending or last committed entries can be NULL.
[email protected]6df40742009-03-19 22:24:50231 const NavigationEntry* pending_entry =
[email protected]ce3fa3c2009-04-20 19:55:57232 contents->controller().pending_entry();
[email protected]cd3d7892009-03-04 23:55:06233 const NavigationEntry* last_committed_entry =
[email protected]ce3fa3c2009-04-20 19:55:57234 contents->controller().GetLastCommittedEntry();
[email protected]cd3d7892009-03-04 23:55:06235 if ((last_committed_entry &&
[email protected]ebe89e062009-08-13 23:16:54236 LowerCaseEqualsASCII(last_committed_entry->virtual_url().spec(),
[email protected]37ae3f22011-07-12 03:56:14237 chrome::kChromeUIMemoryURL)) ||
[email protected]cd3d7892009-03-04 23:55:06238 (pending_entry &&
[email protected]ebe89e062009-08-13 23:16:54239 LowerCaseEqualsASCII(pending_entry->virtual_url().spec(),
[email protected]37ae3f22011-07-12 03:56:14240 chrome::kChromeUIMemoryURL)))
[email protected]a27a9382009-02-11 23:55:10241 process.is_diagnostics = true;
initial.commit09911bf2008-07-26 23:55:29242 }
243 }
[email protected]54fd1d32009-09-01 00:12:58244
[email protected]1fd5302c2011-05-28 04:06:43245#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]54fd1d32009-09-01 00:12:58246 if (process.pid == zygote_pid) {
247 process.type = ChildProcessInfo::ZYGOTE_PROCESS;
248 } else if (process.pid == sandbox_helper_pid) {
249 process.type = ChildProcessInfo::SANDBOX_HELPER_PROCESS;
250 }
251#endif
initial.commit09911bf2008-07-26 23:55:29252 }
253
[email protected]a27a9382009-02-11 23:55:10254 // Get rid of other Chrome processes that are from a different profile.
[email protected]54fd1d32009-09-01 00:12:58255 for (size_t index = 0; index < chrome_browser->processes.size();
[email protected]a27a9382009-02-11 23:55:10256 index++) {
[email protected]54fd1d32009-09-01 00:12:58257 if (chrome_browser->processes[index].type ==
[email protected]a27a9382009-02-11 23:55:10258 ChildProcessInfo::UNKNOWN_PROCESS) {
[email protected]54fd1d32009-09-01 00:12:58259 chrome_browser->processes.erase(
260 chrome_browser->processes.begin() + index);
[email protected]a436d922009-02-13 23:16:42261 index--;
[email protected]a27a9382009-02-11 23:55:10262 }
263 }
264
initial.commit09911bf2008-07-26 23:55:29265 UpdateHistograms();
266
267 OnDetailsAvailable();
268}
269
270void MemoryDetails::UpdateHistograms() {
271 // Reports a set of memory metrics to UMA.
[email protected]57c4b852009-08-17 21:59:29272 // Memory is measured in KB.
initial.commit09911bf2008-07-26 23:55:29273
[email protected]54fd1d32009-09-01 00:12:58274 const ProcessData& browser = *ChromeBrowser();
initial.commit09911bf2008-07-26 23:55:29275 size_t aggregate_memory = 0;
[email protected]fcf79352010-12-28 20:13:20276 int chrome_count = 0;
277 int extension_count = 0;
[email protected]a27a9382009-02-11 23:55:10278 int plugin_count = 0;
[email protected]eef348fb2011-08-01 21:11:08279 int pepper_plugin_count = 0;
[email protected]fcf79352010-12-28 20:13:20280 int renderer_count = 0;
281 int other_count = 0;
[email protected]a27a9382009-02-11 23:55:10282 int worker_count = 0;
initial.commit09911bf2008-07-26 23:55:29283 for (size_t index = 0; index < browser.processes.size(); index++) {
[email protected]921cd0cc2008-10-21 22:30:55284 int sample = static_cast<int>(browser.processes[index].working_set.priv);
285 aggregate_memory += sample;
[email protected]a27a9382009-02-11 23:55:10286 switch (browser.processes[index].type) {
[email protected]f164cea2009-11-05 23:37:40287 case ChildProcessInfo::BROWSER_PROCESS:
288 UMA_HISTOGRAM_MEMORY_KB("Memory.Browser", sample);
289 break;
[email protected]fcf79352010-12-28 20:13:20290 case ChildProcessInfo::RENDER_PROCESS: {
291 ChildProcessInfo::RendererProcessType renderer_type =
292 browser.processes[index].renderer_type;
293 switch (renderer_type) {
294 case ChildProcessInfo::RENDERER_EXTENSION:
295 UMA_HISTOGRAM_MEMORY_KB("Memory.Extension", sample);
296 extension_count++;
297 break;
298 case ChildProcessInfo::RENDERER_CHROME:
299 UMA_HISTOGRAM_MEMORY_KB("Memory.Chrome", sample);
300 chrome_count++;
301 break;
302 case ChildProcessInfo::RENDERER_UNKNOWN:
303 NOTREACHED() << "Unknown renderer process type.";
304 break;
305 case ChildProcessInfo::RENDERER_NORMAL:
306 default:
307 // TODO(erikkay): Should we bother splitting out the other subtypes?
308 UMA_HISTOGRAM_MEMORY_KB("Memory.Renderer", sample);
309 renderer_count++;
310 break;
311 }
[email protected]f164cea2009-11-05 23:37:40312 break;
[email protected]fcf79352010-12-28 20:13:20313 }
[email protected]f164cea2009-11-05 23:37:40314 case ChildProcessInfo::PLUGIN_PROCESS:
315 UMA_HISTOGRAM_MEMORY_KB("Memory.Plugin", sample);
316 plugin_count++;
317 break;
318 case ChildProcessInfo::WORKER_PROCESS:
319 UMA_HISTOGRAM_MEMORY_KB("Memory.Worker", sample);
320 worker_count++;
321 break;
322 case ChildProcessInfo::UTILITY_PROCESS:
323 UMA_HISTOGRAM_MEMORY_KB("Memory.Utility", sample);
[email protected]fcf79352010-12-28 20:13:20324 other_count++;
[email protected]f164cea2009-11-05 23:37:40325 break;
326 case ChildProcessInfo::ZYGOTE_PROCESS:
327 UMA_HISTOGRAM_MEMORY_KB("Memory.Zygote", sample);
[email protected]fcf79352010-12-28 20:13:20328 other_count++;
[email protected]f164cea2009-11-05 23:37:40329 break;
330 case ChildProcessInfo::SANDBOX_HELPER_PROCESS:
331 UMA_HISTOGRAM_MEMORY_KB("Memory.SandboxHelper", sample);
[email protected]fcf79352010-12-28 20:13:20332 other_count++;
[email protected]f164cea2009-11-05 23:37:40333 break;
[email protected]103607e2010-02-01 18:57:09334 case ChildProcessInfo::NACL_LOADER_PROCESS:
[email protected]f164cea2009-11-05 23:37:40335 UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClient", sample);
[email protected]fcf79352010-12-28 20:13:20336 other_count++;
[email protected]f164cea2009-11-05 23:37:40337 break;
[email protected]aef8d5ae2010-03-17 22:40:52338 case ChildProcessInfo::NACL_BROKER_PROCESS:
339 UMA_HISTOGRAM_MEMORY_KB("Memory.NativeClientBroker", sample);
[email protected]fcf79352010-12-28 20:13:20340 other_count++;
[email protected]aef8d5ae2010-03-17 22:40:52341 break;
[email protected]96fcbf2d2010-08-03 16:10:27342 case ChildProcessInfo::GPU_PROCESS:
343 UMA_HISTOGRAM_MEMORY_KB("Memory.Gpu", sample);
[email protected]fcf79352010-12-28 20:13:20344 other_count++;
[email protected]96fcbf2d2010-08-03 16:10:27345 break;
[email protected]eef348fb2011-08-01 21:11:08346 case ChildProcessInfo::PPAPI_PLUGIN_PROCESS:
347 UMA_HISTOGRAM_MEMORY_KB("Memory.PepperPlugin", sample);
348 pepper_plugin_count++;
349 break;
[email protected]f164cea2009-11-05 23:37:40350 default:
351 NOTREACHED();
[email protected]eef348fb2011-08-01 21:11:08352 break;
initial.commit09911bf2008-07-26 23:55:29353 }
354 }
[email protected]57c4b852009-08-17 21:59:29355 UMA_HISTOGRAM_MEMORY_KB("Memory.BackingStore",
356 BackingStoreManager::MemorySize() / 1024);
[email protected]a27a9382009-02-11 23:55:10357
[email protected]553dba62009-02-24 19:08:23358 UMA_HISTOGRAM_COUNTS_100("Memory.ProcessCount",
initial.commit09911bf2008-07-26 23:55:29359 static_cast<int>(browser.processes.size()));
[email protected]fcf79352010-12-28 20:13:20360 UMA_HISTOGRAM_COUNTS_100("Memory.ChromeProcessCount", chrome_count);
361 UMA_HISTOGRAM_COUNTS_100("Memory.ExtensionProcessCount", extension_count);
362 UMA_HISTOGRAM_COUNTS_100("Memory.OtherProcessCount", other_count);
[email protected]553dba62009-02-24 19:08:23363 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count);
[email protected]eef348fb2011-08-01 21:11:08364 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount",
365 pepper_plugin_count);
[email protected]fcf79352010-12-28 20:13:20366 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count);
[email protected]553dba62009-02-24 19:08:23367 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count);
[email protected]f164cea2009-11-05 23:37:40368 // TODO(viettrungluu): Do we want separate counts for the other
369 // (platform-specific) process types?
[email protected]921cd0cc2008-10-21 22:30:55370
371 int total_sample = static_cast<int>(aggregate_memory / 1000);
[email protected]553dba62009-02-24 19:08:23372 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample);
initial.commit09911bf2008-07-26 23:55:29373}