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

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

Issue 371025: More memory stats code cleanup:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: multiply uses by 1024 to keep stats consistent with old runs Created 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/perf/mem_usage.h"
6
7 #include <mach/mach.h>
8
9 #include <vector>
10
11 #include "base/logging.h"
12 #include "base/process_util.h"
13 #include "chrome/test/chrome_process_util.h"
14
15 // Bytes committed by the system.
16 size_t GetSystemCommitCharge() {
17 host_name_port_t host = mach_host_self();
18 mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
19 vm_statistics_data_t data;
20 kern_return_t kr = host_statistics(host, HOST_VM_INFO,
21 reinterpret_cast<host_info_t>(&data),
22 &count);
23 if (kr)
24 return 0;
25
26 vm_size_t page_size;
27 kr = host_page_size(host, &page_size);
28 if (kr)
29 return 0;
30
31 return data.active_count * page_size;
32 }
33
34 void PrintChromeMemoryUsageInfo() {
35 NOTIMPLEMENTED();
36 }
37
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698