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

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

Issue 1272573006: When allocation rate is low and we are close to the new space limit, we should perform a scavenge d… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 f76c48bf9e3ed615ac7f04af25bda87b92014eb0..e9324de4672738681e5119aad59266081f101102 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -129,10 +129,7 @@ bool GCIdleTimeHandler::ShouldDoScavenge(
// We do not know the allocation throughput before the first scavenge.
// TODO(hpayer): Estimate allocation throughput before the first scavenge.
- if (new_space_allocation_throughput_in_bytes_per_ms == 0) {
- new_space_allocation_limit =
- static_cast<size_t>(new_space_size * kConservativeTimeRatio);
- } else {
+ if (new_space_allocation_throughput_in_bytes_per_ms > 0) {
// 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;
@@ -143,6 +140,13 @@ bool GCIdleTimeHandler::ShouldDoScavenge(
}
}
+ if (new_space_allocation_throughput_in_bytes_per_ms <
+ kLowAllocationThroughput) {
+ new_space_allocation_limit =
+ Min(new_space_allocation_limit,
+ static_cast<size_t>(new_space_size * kConservativeTimeRatio));
+ }
+
// The allocated new space limit to trigger a scavange has to be at least
// kMinimumNewSpaceSizeToPerformScavenge.
if (new_space_allocation_limit < kMinimumNewSpaceSizeToPerformScavenge) {
« 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