OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project 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 #ifndef V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 5 #ifndef V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
6 #define V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 6 #define V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
7 | 7 |
8 #include "src/globals.h" | 8 #include "src/globals.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 // Number of idle mark-compact events, after which idle handler will finish | 102 // Number of idle mark-compact events, after which idle handler will finish |
103 // idle round. | 103 // idle round. |
104 static const int kMaxMarkCompactsInIdleRound; | 104 static const int kMaxMarkCompactsInIdleRound; |
105 | 105 |
106 // Number of scavenges that will trigger start of new idle round. | 106 // Number of scavenges that will trigger start of new idle round. |
107 static const int kIdleScavengeThreshold; | 107 static const int kIdleScavengeThreshold; |
108 | 108 |
109 // Heap size threshold below which we prefer mark-compact over incremental | 109 // Heap size threshold below which we prefer mark-compact over incremental |
110 // step. | 110 // step. |
111 static const size_t kSmallHeapSize = 2 * kPointerSize * MB; | 111 static const size_t kSmallHeapSize = 4 * kPointerSize * MB; |
112 | 112 |
113 // That is the maximum idle time we will have during frame rendering. | 113 // That is the maximum idle time we will have during frame rendering. |
114 static const size_t kMaxFrameRenderingIdleTime = 16; | 114 static const size_t kMaxFrameRenderingIdleTime = 16; |
115 | 115 |
116 // If less than that much memory is left in the new space, we consider it | 116 // If less than that much memory is left in the new space, we consider it |
117 // as almost full and force a new space collection earlier in the idle time. | 117 // as almost full and force a new space collection earlier in the idle time. |
118 static const size_t kNewSpaceAlmostFullTreshold = 100 * KB; | 118 static const size_t kNewSpaceAlmostFullTreshold = 100 * KB; |
119 | 119 |
120 // If we haven't recorded any scavenger events yet, we use a conservative | 120 // If we haven't recorded any scavenger events yet, we use a conservative |
121 // lower bound for the scavenger speed. | 121 // lower bound for the scavenger speed. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int mark_compacts_since_idle_round_started_; | 179 int mark_compacts_since_idle_round_started_; |
180 int scavenges_since_last_idle_round_; | 180 int scavenges_since_last_idle_round_; |
181 | 181 |
182 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 182 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
183 }; | 183 }; |
184 | 184 |
185 } // namespace internal | 185 } // namespace internal |
186 } // namespace v8 | 186 } // namespace v8 |
187 | 187 |
188 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 188 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
OLD | NEW |