OLD | NEW |
| (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 | |
OLD | NEW |