Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: chrome/test/perf/mem_usage.cc

Issue 10895: Add Terminate() to the Process object, have RenderProcessHost use this to avo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/mini_installer_test/chrome_mini_installer.cc ('k') | chrome/test/perf/perftests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <psapi.h> 6 #include <psapi.h>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 PERFORMANCE_INFORMATION info; 75 PERFORMANCE_INFORMATION info;
76 if (InternalGetPerformanceInfo(&info, sizeof(info))) 76 if (InternalGetPerformanceInfo(&info, sizeof(info)))
77 return info.CommitTotal * system_info.dwPageSize; 77 return info.CommitTotal * system_info.dwPageSize;
78 return -1; 78 return -1;
79 } 79 }
80 80
81 void PrintChromeMemoryUsageInfo() { 81 void PrintChromeMemoryUsageInfo() {
82 printf("\n"); 82 printf("\n");
83 BrowserProcessFilter chrome_filter(L""); 83 BrowserProcessFilter chrome_filter(L"");
84 process_util::NamedProcessIterator 84 base::NamedProcessIterator
85 chrome_process_itr(chrome::kBrowserProcessExecutableName, &chrome_filter); 85 chrome_process_itr(chrome::kBrowserProcessExecutableName, &chrome_filter);
86 86
87 const PROCESSENTRY32* chrome_entry; 87 const PROCESSENTRY32* chrome_entry;
88 while (chrome_entry = chrome_process_itr.NextProcessEntry()) { 88 while (chrome_entry = chrome_process_itr.NextProcessEntry()) {
89 uint32 pid = chrome_entry->th32ProcessID; 89 uint32 pid = chrome_entry->th32ProcessID;
90 size_t peak_virtual_size; 90 size_t peak_virtual_size;
91 size_t current_virtual_size; 91 size_t current_virtual_size;
92 size_t peak_working_set_size; 92 size_t peak_working_set_size;
93 size_t current_working_set_size; 93 size_t current_working_set_size;
94 if (GetMemoryInfo(pid, &peak_virtual_size, &current_virtual_size, 94 if (GetMemoryInfo(pid, &peak_virtual_size, &current_virtual_size,
95 &peak_working_set_size, &current_working_set_size)) { 95 &peak_working_set_size, &current_working_set_size)) {
96 if (pid == chrome_filter.browser_process_id()) { 96 if (pid == chrome_filter.browser_process_id()) {
97 wprintf(L"browser_vm_peak = %d\n", peak_virtual_size); 97 wprintf(L"browser_vm_peak = %d\n", peak_virtual_size);
98 wprintf(L"browser_vm_current = %d\n", current_virtual_size); 98 wprintf(L"browser_vm_current = %d\n", current_virtual_size);
99 wprintf(L"browser_ws_peak = %d\n", peak_working_set_size); 99 wprintf(L"browser_ws_peak = %d\n", peak_working_set_size);
100 wprintf(L"browser_ws_final = %d\n", current_working_set_size); 100 wprintf(L"browser_ws_final = %d\n", current_working_set_size);
101 } else { 101 } else {
102 wprintf(L"render_vm_peak = %d\n", peak_virtual_size); 102 wprintf(L"render_vm_peak = %d\n", peak_virtual_size);
103 wprintf(L"render_vm_current = %d\n", current_virtual_size); 103 wprintf(L"render_vm_current = %d\n", current_virtual_size);
104 wprintf(L"render_ws_peak = %d\n", peak_working_set_size); 104 wprintf(L"render_ws_peak = %d\n", peak_working_set_size);
105 wprintf(L"render_ws_final = %d\n", current_working_set_size); 105 wprintf(L"render_ws_final = %d\n", current_working_set_size);
106 } 106 }
107 } 107 }
108 }; 108 };
109 } 109 }
110 110
OLDNEW
« no previous file with comments | « chrome/test/mini_installer_test/chrome_mini_installer.cc ('k') | chrome/test/perf/perftests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698