Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/heap/gc-idle-time-handler.cc

Issue 586643002: Perform scavenges only for small idle times. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/heap/gc-idle-time-handler.h" 5 #include "src/heap/gc-idle-time-handler.h"
6 #include "src/heap/gc-tracer.h" 6 #include "src/heap/gc-tracer.h"
7 #include "src/utils.h" 7 #include "src/utils.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // if context was disposed or if we are allowed to still do full garbage 103 // if context was disposed or if we are allowed to still do full garbage
104 // collections during this idle round or if we are not allowed to start 104 // collections during this idle round or if we are not allowed to start
105 // incremental marking. Otherwise we do not perform garbage collection to 105 // incremental marking. Otherwise we do not perform garbage collection to
106 // keep system utilization low. 106 // keep system utilization low.
107 // (4) If sweeping is in progress and we received a large enough idle time 107 // (4) If sweeping is in progress and we received a large enough idle time
108 // request, we finalize sweeping here. 108 // request, we finalize sweeping here.
109 // (5) If incremental marking is in progress, we perform a marking step. Note, 109 // (5) If incremental marking is in progress, we perform a marking step. Note,
110 // that this currently may trigger a full garbage collection. 110 // that this currently may trigger a full garbage collection.
111 GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, 111 GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
112 HeapState heap_state) { 112 HeapState heap_state) {
113 if (ScavangeMayHappenSoon( 113 if (idle_time_in_ms <= kMaxFrameRenderingIdleTime &&
114 ScavangeMayHappenSoon(
114 heap_state.available_new_space_memory, 115 heap_state.available_new_space_memory,
115 heap_state.new_space_allocation_throughput_in_bytes_per_ms) && 116 heap_state.new_space_allocation_throughput_in_bytes_per_ms) &&
116 idle_time_in_ms >= 117 idle_time_in_ms >=
117 EstimateScavengeTime(heap_state.new_space_capacity, 118 EstimateScavengeTime(heap_state.new_space_capacity,
118 heap_state.scavenge_speed_in_bytes_per_ms)) { 119 heap_state.scavenge_speed_in_bytes_per_ms)) {
119 return GCIdleTimeAction::Scavenge(); 120 return GCIdleTimeAction::Scavenge();
120 } 121 }
121 if (IsMarkCompactIdleRoundFinished()) { 122 if (IsMarkCompactIdleRoundFinished()) {
122 if (EnoughGarbageSinceLastIdleRound() || heap_state.contexts_disposed > 0) { 123 if (EnoughGarbageSinceLastIdleRound() || heap_state.contexts_disposed > 0) {
123 StartIdleRound(); 124 StartIdleRound();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (heap_state.incremental_marking_stopped && 165 if (heap_state.incremental_marking_stopped &&
165 !heap_state.can_start_incremental_marking) { 166 !heap_state.can_start_incremental_marking) {
166 return GCIdleTimeAction::Nothing(); 167 return GCIdleTimeAction::Nothing();
167 } 168 }
168 size_t step_size = EstimateMarkingStepSize( 169 size_t step_size = EstimateMarkingStepSize(
169 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); 170 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms);
170 return GCIdleTimeAction::IncrementalMarking(step_size); 171 return GCIdleTimeAction::IncrementalMarking(step_size);
171 } 172 }
172 } 173 }
173 } 174 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698