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

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

Issue 1138643003: Make sure that idle scavenges are just performed when enough objects are allocated in new space. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 // We do not know the allocation throughput before the first Scavenge. 125 // We do not know the allocation throughput before the first Scavenge.
126 // TODO(hpayer): Estimate allocation throughput before the first Scavenge. 126 // TODO(hpayer): Estimate allocation throughput before the first Scavenge.
127 if (new_space_allocation_throughput_in_bytes_per_ms == 0) { 127 if (new_space_allocation_throughput_in_bytes_per_ms == 0) {
128 new_space_allocation_limit = 128 new_space_allocation_limit =
129 static_cast<size_t>(new_space_size * kConservativeTimeRatio); 129 static_cast<size_t>(new_space_size * kConservativeTimeRatio);
130 } else { 130 } else {
131 // We have to trigger scavenge before we reach the end of new space. 131 // We have to trigger scavenge before we reach the end of new space.
132 size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms * 132 size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms *
133 kTimeUntilNextIdleEvent; 133 kTimeUntilNextIdleEvent;
134 if (adjust_limit > new_space_allocation_limit) 134 if (adjust_limit > new_space_allocation_limit) {
135 new_space_allocation_limit = 0; 135 new_space_allocation_limit = 0;
136 else 136 } else {
137 new_space_allocation_limit -= adjust_limit; 137 new_space_allocation_limit -= adjust_limit;
138 }
139 }
140
141 // The allocated new space limit to trigger a Scavange has to be at least
Erik Corry 2015/05/15 13:03:16 Scavange -> scavenge <-- note vowel change
Hannes Payer (out of office) 2015/05/15 15:12:49 Done. Fixed them all.
142 // kMinimumNewSpaceSizeToPerformScavenge.
143 if (new_space_allocation_limit < kMinimumNewSpaceSizeToPerformScavenge) {
144 new_space_allocation_limit = kMinimumNewSpaceSizeToPerformScavenge;
138 } 145 }
139 146
140 if (scavenge_speed_in_bytes_per_ms == 0) { 147 if (scavenge_speed_in_bytes_per_ms == 0) {
141 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed; 148 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed;
142 } 149 }
143 150
144 if (new_space_allocation_limit <= used_new_space_size) { 151 if (new_space_allocation_limit <= used_new_space_size) {
145 if (used_new_space_size / scavenge_speed_in_bytes_per_ms <= 152 if (used_new_space_size / scavenge_speed_in_bytes_per_ms <=
146 idle_time_in_ms) { 153 idle_time_in_ms) {
147 return true; 154 return true;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 383 }
377 if (mutator_gcs > idle_mark_compacts_) { 384 if (mutator_gcs > idle_mark_compacts_) {
378 return kReduceLatency; 385 return kReduceLatency;
379 } 386 }
380 break; 387 break;
381 } 388 }
382 return mode_; 389 return mode_;
383 } 390 }
384 } 391 }
385 } 392 }
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