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

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

Issue 1034403002: Allow more scavenges in idle notification by increasing the new space limit distance. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 new_space_allocation_limit = new_space_size; 125 new_space_allocation_limit = new_space_size;
126 } 126 }
127 127
128 // We do not know the allocation throughput before the first Scavenge. 128 // We do not know the allocation throughput before the first Scavenge.
129 // TODO(hpayer): Estimate allocation throughput before the first Scavenge. 129 // TODO(hpayer): Estimate allocation throughput before the first Scavenge.
130 if (new_space_allocation_throughput_in_bytes_per_ms == 0) { 130 if (new_space_allocation_throughput_in_bytes_per_ms == 0) {
131 new_space_allocation_limit = 131 new_space_allocation_limit =
132 static_cast<size_t>(new_space_size * kConservativeTimeRatio); 132 static_cast<size_t>(new_space_size * kConservativeTimeRatio);
133 } else { 133 } else {
134 // We have to trigger scavenge before we reach the end of new space. 134 // We have to trigger scavenge before we reach the end of new space.
135 new_space_allocation_limit -= 135 size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms *
136 new_space_allocation_throughput_in_bytes_per_ms * kMaxScheduledIdleTime; 136 kTimeUntilNextIdleEvent;
137 if (adjust_limit > new_space_allocation_limit)
138 new_space_allocation_limit = 0;
139 else
140 new_space_allocation_limit -= adjust_limit;
137 } 141 }
138 142
139 if (scavenge_speed_in_bytes_per_ms == 0) { 143 if (scavenge_speed_in_bytes_per_ms == 0) {
140 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed; 144 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed;
141 } 145 }
142 146
143 if (new_space_allocation_limit <= used_new_space_size) { 147 if (new_space_allocation_limit <= used_new_space_size) {
144 if (used_new_space_size / scavenge_speed_in_bytes_per_ms <= 148 if (used_new_space_size / scavenge_speed_in_bytes_per_ms <=
145 idle_time_in_ms) { 149 idle_time_in_ms) {
146 return true; 150 return true;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 !heap_state.can_start_incremental_marking) { 255 !heap_state.can_start_incremental_marking) {
252 return GCIdleTimeAction::Nothing(); 256 return GCIdleTimeAction::Nothing();
253 } 257 }
254 size_t step_size = EstimateMarkingStepSize( 258 size_t step_size = EstimateMarkingStepSize(
255 static_cast<size_t>(kIncrementalMarkingStepTimeInMs), 259 static_cast<size_t>(kIncrementalMarkingStepTimeInMs),
256 heap_state.incremental_marking_speed_in_bytes_per_ms); 260 heap_state.incremental_marking_speed_in_bytes_per_ms);
257 return GCIdleTimeAction::IncrementalMarking(step_size); 261 return GCIdleTimeAction::IncrementalMarking(step_size);
258 } 262 }
259 } 263 }
260 } 264 }
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698