OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 // This file/namespace contains utility functions for enumerating, ending and | 5 // This file/namespace contains utility functions for enumerating, ending and |
6 // computing statistics of processes. | 6 // computing statistics of processes. |
7 | 7 |
8 #ifndef BASE_PROCESS_UTIL_H_ | 8 #ifndef BASE_PROCESS_UTIL_H_ |
9 #define BASE_PROCESS_UTIL_H_ | 9 #define BASE_PROCESS_UTIL_H_ |
10 | 10 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 std::vector<kinfo_proc> kinfo_procs_; | 279 std::vector<kinfo_proc> kinfo_procs_; |
280 size_t index_of_kinfo_proc_; | 280 size_t index_of_kinfo_proc_; |
281 #endif | 281 #endif |
282 ProcessEntry entry_; | 282 ProcessEntry entry_; |
283 const ProcessFilter* filter_; | 283 const ProcessFilter* filter_; |
284 | 284 |
285 DISALLOW_EVIL_CONSTRUCTORS(NamedProcessIterator); | 285 DISALLOW_EVIL_CONSTRUCTORS(NamedProcessIterator); |
286 }; | 286 }; |
287 | 287 |
288 // Working Set (resident) memory usage broken down by | 288 // Working Set (resident) memory usage broken down by |
| 289 // |
| 290 // On Windows: |
289 // priv (private): These pages (kbytes) cannot be shared with any other process. | 291 // priv (private): These pages (kbytes) cannot be shared with any other process. |
290 // shareable: These pages (kbytes) can be shared with other processes under | 292 // shareable: These pages (kbytes) can be shared with other processes under |
291 // the right circumstances. | 293 // the right circumstances. |
292 // shared : These pages (kbytes) are currently shared with at least one | 294 // shared : These pages (kbytes) are currently shared with at least one |
293 // other process. | 295 // other process. |
| 296 // |
| 297 // On Linux: |
| 298 // priv: Pages mapped only by this process |
| 299 // shared: PSS or 0 if the kernel doesn't support this |
| 300 // shareable: 0 |
294 struct WorkingSetKBytes { | 301 struct WorkingSetKBytes { |
| 302 WorkingSetKBytes() : priv(0), shareable(0), shared(0) {} |
295 size_t priv; | 303 size_t priv; |
296 size_t shareable; | 304 size_t shareable; |
297 size_t shared; | 305 size_t shared; |
298 }; | 306 }; |
299 | 307 |
300 // Committed (resident + paged) memory usage broken down by | 308 // Committed (resident + paged) memory usage broken down by |
301 // private: These pages cannot be shared with any other process. | 309 // private: These pages cannot be shared with any other process. |
302 // mapped: These pages are mapped into the view of a section (backed by | 310 // mapped: These pages are mapped into the view of a section (backed by |
303 // pagefile.sys) | 311 // pagefile.sys) |
304 // image: These pages are mapped into the view of an image section (backed by | 312 // image: These pages are mapped into the view of an image section (backed by |
305 // file system) | 313 // file system) |
306 struct CommittedKBytes { | 314 struct CommittedKBytes { |
| 315 CommittedKBytes() : priv(0), mapped(0), image(0) {} |
307 size_t priv; | 316 size_t priv; |
308 size_t mapped; | 317 size_t mapped; |
309 size_t image; | 318 size_t image; |
310 }; | 319 }; |
311 | 320 |
312 // Free memory (Megabytes marked as free) in the 2G process address space. | 321 // Free memory (Megabytes marked as free) in the 2G process address space. |
313 // total : total amount in megabytes marked as free. Maximum value is 2048. | 322 // total : total amount in megabytes marked as free. Maximum value is 2048. |
314 // largest : size of the largest contiguous amount of memory found. It is | 323 // largest : size of the largest contiguous amount of memory found. It is |
315 // always smaller or equal to FreeMBytes::total. | 324 // always smaller or equal to FreeMBytes::total. |
316 // largest_ptr: starting address of the largest memory block. | 325 // largest_ptr: starting address of the largest memory block. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 410 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
402 void EnableTerminationOnHeapCorruption(); | 411 void EnableTerminationOnHeapCorruption(); |
403 | 412 |
404 // If supported on the platform, and the user has sufficent rights, increase | 413 // If supported on the platform, and the user has sufficent rights, increase |
405 // the current process's scheduling priority to a high priority. | 414 // the current process's scheduling priority to a high priority. |
406 void RaiseProcessToHighPriority(); | 415 void RaiseProcessToHighPriority(); |
407 | 416 |
408 } // namespace base | 417 } // namespace base |
409 | 418 |
410 #endif // BASE_PROCESS_UTIL_H_ | 419 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |