| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/memory_pressure/direct_memory_pressure_calculator_win.h" | 5 #include "components/memory_pressure/direct_memory_pressure_calculator_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 8 #include "base/process/process_metrics.h" |
| 9 |
| 7 namespace memory_pressure { | 10 namespace memory_pressure { |
| 8 | 11 |
| 9 #if defined(MEMORY_PRESSURE_IS_POLLING) | 12 #if defined(MEMORY_PRESSURE_IS_POLLING) |
| 10 | 13 |
| 11 namespace { | 14 namespace { |
| 12 | 15 |
| 13 static const int kKBperMB = 1024; | 16 const int kKBperMB = 1024; |
| 14 | 17 |
| 15 } // namespace | 18 } // namespace |
| 16 | 19 |
| 17 // A system is considered 'high memory' if it has more than 1.5GB of system | 20 // A system is considered 'high memory' if it has more than 1.5GB of system |
| 18 // memory available for use by the memory manager (not reserved for hardware | 21 // memory available for use by the memory manager (not reserved for hardware |
| 19 // and drivers). This is a fuzzy version of the ~2GB discussed below. | 22 // and drivers). This is a fuzzy version of the ~2GB discussed below. |
| 20 const int DirectMemoryPressureCalculator::kLargeMemoryThresholdMb = 1536; | 23 const int DirectMemoryPressureCalculator::kLargeMemoryThresholdMb = 1536; |
| 21 | 24 |
| 22 // These are the default thresholds used for systems with < ~2GB of physical | 25 // These are the default thresholds used for systems with < ~2GB of physical |
| 23 // memory. Such systems have been observed to always maintain ~100MB of | 26 // memory. Such systems have been observed to always maintain ~100MB of |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 critical_threshold_mb_ = kLargeMemoryDefaultCriticalThresholdMb; | 107 critical_threshold_mb_ = kLargeMemoryDefaultCriticalThresholdMb; |
| 105 } else { | 108 } else { |
| 106 moderate_threshold_mb_ = kSmallMemoryDefaultModerateThresholdMb; | 109 moderate_threshold_mb_ = kSmallMemoryDefaultModerateThresholdMb; |
| 107 critical_threshold_mb_ = kSmallMemoryDefaultCriticalThresholdMb; | 110 critical_threshold_mb_ = kSmallMemoryDefaultCriticalThresholdMb; |
| 108 } | 111 } |
| 109 } | 112 } |
| 110 | 113 |
| 111 #endif // defined(MEMORY_PRESSURE_IS_POLLING) | 114 #endif // defined(MEMORY_PRESSURE_IS_POLLING) |
| 112 | 115 |
| 113 } // namespace memory_pressure | 116 } // namespace memory_pressure |
| OLD | NEW |