OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/memory_details.h" | 5 #include "chrome/browser/memory_details.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 UMA_HISTOGRAM_MEMORY_KB("Memory.PepperPluginBroker", sample); | 452 UMA_HISTOGRAM_MEMORY_KB("Memory.PepperPluginBroker", sample); |
453 pepper_plugin_broker_count++; | 453 pepper_plugin_broker_count++; |
454 break; | 454 break; |
455 default: | 455 default: |
456 NOTREACHED(); | 456 NOTREACHED(); |
457 break; | 457 break; |
458 } | 458 } |
459 } | 459 } |
460 UMA_HISTOGRAM_MEMORY_KB("Memory.BackingStore", | 460 UMA_HISTOGRAM_MEMORY_KB("Memory.BackingStore", |
461 RenderWidgetHost::BackingStoreMemorySize() / 1024); | 461 RenderWidgetHost::BackingStoreMemorySize() / 1024); |
| 462 #if defined(OS_CHROMEOS) |
| 463 // Chrome OS exposes system-wide graphics driver memory which has historically |
| 464 // been a source of leak/bloat. |
| 465 base::SystemMemoryInfoKB meminfo; |
| 466 if (base::GetSystemMemoryInfo(&meminfo) && meminfo.gem_size != -1) |
| 467 UMA_HISTOGRAM_MEMORY_MB("Memory.Graphics", meminfo.gem_size / 1024 / 1024); |
| 468 #endif |
462 | 469 |
463 UMA_HISTOGRAM_COUNTS_100("Memory.ProcessCount", | 470 UMA_HISTOGRAM_COUNTS_100("Memory.ProcessCount", |
464 static_cast<int>(browser.processes.size())); | 471 static_cast<int>(browser.processes.size())); |
465 UMA_HISTOGRAM_COUNTS_100("Memory.ChromeProcessCount", chrome_count); | 472 UMA_HISTOGRAM_COUNTS_100("Memory.ChromeProcessCount", chrome_count); |
466 UMA_HISTOGRAM_COUNTS_100("Memory.ExtensionProcessCount", extension_count); | 473 UMA_HISTOGRAM_COUNTS_100("Memory.ExtensionProcessCount", extension_count); |
467 UMA_HISTOGRAM_COUNTS_100("Memory.OtherProcessCount", other_count); | 474 UMA_HISTOGRAM_COUNTS_100("Memory.OtherProcessCount", other_count); |
468 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count); | 475 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count); |
469 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", | 476 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", |
470 pepper_plugin_count); | 477 pepper_plugin_count); |
471 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginBrokerProcessCount", | 478 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginBrokerProcessCount", |
472 pepper_plugin_broker_count); | 479 pepper_plugin_broker_count); |
473 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); | 480 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); |
474 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); | 481 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); |
475 // TODO(viettrungluu): Do we want separate counts for the other | 482 // TODO(viettrungluu): Do we want separate counts for the other |
476 // (platform-specific) process types? | 483 // (platform-specific) process types? |
477 | 484 |
478 int total_sample = static_cast<int>(aggregate_memory / 1000); | 485 int total_sample = static_cast<int>(aggregate_memory / 1000); |
479 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); | 486 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); |
480 } | 487 } |
OLD | NEW |