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

Unified 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, 9 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 80417a7f25dcf81c20ebf6b8916f3855a82f5278..5c8354d935701b6a680b124753b47539bcf6efae 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -132,8 +132,12 @@ bool GCIdleTimeHandler::ShouldDoScavenge(
static_cast<size_t>(new_space_size * kConservativeTimeRatio);
} else {
// We have to trigger scavenge before we reach the end of new space.
- new_space_allocation_limit -=
- new_space_allocation_throughput_in_bytes_per_ms * kMaxScheduledIdleTime;
+ size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms *
+ kTimeUntilNextIdleEvent;
+ if (adjust_limit > new_space_allocation_limit)
+ new_space_allocation_limit = 0;
+ else
+ new_space_allocation_limit -= adjust_limit;
}
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