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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-idle-time-handler.cc
diff --git a/src/heap/gc-idle-time-handler.cc b/src/heap/gc-idle-time-handler.cc
index 19c9dab668299b13b14fdf05c0dfd106d25f5a4c..ba456cf13e70f6f82550ab1ff35a0f836bb17e80 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -131,10 +131,17 @@ bool GCIdleTimeHandler::ShouldDoScavenge(
// We have to trigger scavenge before we reach the end of new space.
size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms *
kTimeUntilNextIdleEvent;
- if (adjust_limit > new_space_allocation_limit)
+ if (adjust_limit > new_space_allocation_limit) {
new_space_allocation_limit = 0;
- else
+ } else {
new_space_allocation_limit -= adjust_limit;
+ }
+ }
+
+ // 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.
+ // kMinimumNewSpaceSizeToPerformScavenge.
+ if (new_space_allocation_limit < kMinimumNewSpaceSizeToPerformScavenge) {
+ new_space_allocation_limit = kMinimumNewSpaceSizeToPerformScavenge;
}
if (scavenge_speed_in_bytes_per_ms == 0) {
« 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