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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 // methods. | 316 // methods. |
317 class ProcessMetrics { | 317 class ProcessMetrics { |
318 public: | 318 public: |
319 // Creates a ProcessMetrics for the specified process. | 319 // Creates a ProcessMetrics for the specified process. |
320 // The caller owns the returned object. | 320 // The caller owns the returned object. |
321 static ProcessMetrics* CreateProcessMetrics(ProcessHandle process); | 321 static ProcessMetrics* CreateProcessMetrics(ProcessHandle process); |
322 | 322 |
323 ~ProcessMetrics(); | 323 ~ProcessMetrics(); |
324 | 324 |
325 // Returns the current space allocated for the pagefile, in bytes (these pages | 325 // Returns the current space allocated for the pagefile, in bytes (these pages |
326 // may or may not be in memory). | 326 // may or may not be in memory). On Linux, this returns the total virtual |
| 327 // memory size. |
327 size_t GetPagefileUsage() const; | 328 size_t GetPagefileUsage() const; |
328 // Returns the peak space allocated for the pagefile, in bytes. | 329 // Returns the peak space allocated for the pagefile, in bytes. |
329 size_t GetPeakPagefileUsage() const; | 330 size_t GetPeakPagefileUsage() const; |
330 // Returns the current working set size, in bytes. | 331 // Returns the current working set size, in bytes. On Linux, this returns |
| 332 // the resident set size. |
331 size_t GetWorkingSetSize() const; | 333 size_t GetWorkingSetSize() const; |
| 334 // Returns the peak working set size, in bytes. |
| 335 size_t GetPeakWorkingSetSize() const; |
332 // Returns private usage, in bytes. Private bytes is the amount | 336 // Returns private usage, in bytes. Private bytes is the amount |
333 // of memory currently allocated to a process that cannot be shared. | 337 // of memory currently allocated to a process that cannot be shared. |
334 // Note: returns 0 on unsupported OSes: prior to XP SP2. | 338 // Note: returns 0 on unsupported OSes: prior to XP SP2. |
335 size_t GetPrivateBytes() const; | 339 size_t GetPrivateBytes() const; |
336 // Fills a CommittedKBytes with both resident and paged | 340 // Fills a CommittedKBytes with both resident and paged |
337 // memory usage as per definition of CommittedBytes. | 341 // memory usage as per definition of CommittedBytes. |
338 void GetCommittedKBytes(CommittedKBytes* usage) const; | 342 void GetCommittedKBytes(CommittedKBytes* usage) const; |
339 // Fills a WorkingSetKBytes containing resident private and shared memory | 343 // Fills a WorkingSetKBytes containing resident private and shared memory |
340 // usage in bytes, as per definition of WorkingSetBytes. | 344 // usage in bytes, as per definition of WorkingSetBytes. |
341 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const; | 345 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 391 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
388 void EnableTerminationOnHeapCorruption(); | 392 void EnableTerminationOnHeapCorruption(); |
389 | 393 |
390 // If supported on the platform, and the user has sufficent rights, increase | 394 // If supported on the platform, and the user has sufficent rights, increase |
391 // the current process's scheduling priority to a high priority. | 395 // the current process's scheduling priority to a high priority. |
392 void RaiseProcessToHighPriority(); | 396 void RaiseProcessToHighPriority(); |
393 | 397 |
394 } // namespace base | 398 } // namespace base |
395 | 399 |
396 #endif // BASE_PROCESS_UTIL_H_ | 400 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |