Commit bffde6f4 authored by hpayer's avatar hpayer Committed by Commit bot

Allow more scavenges in idle notification by increasing the new space limit distance.

BUG=chromium:468554
LOG=n

Review URL: https://codereview.chromium.org/1034403002

Cr-Commit-Position: refs/heads/master@{#27517}
parent f5a6f73c
......@@ -131,8 +131,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) {
......
......@@ -122,6 +122,10 @@ class GCIdleTimeHandler {
// 16 ms when there is currently no rendering going on.
static const size_t kMaxScheduledIdleTime = 50;
// We conservatively assume that in the next kTimeUntilNextIdleEvent ms
// no idle notification happens.
static const size_t kTimeUntilNextIdleEvent = 100;
// If we haven't recorded any scavenger events yet, we use a conservative
// lower bound for the scavenger speed.
static const size_t kInitialConservativeScavengeSpeed = 100 * KB;
......
......@@ -136,7 +136,7 @@ TEST_F(GCIdleTimeHandlerTest, DoScavengeUnknownScavengeSpeed) {
GCIdleTimeHandler::HeapState heap_state = DefaultHeapState();
heap_state.used_new_space_size = kNewSpaceCapacity;
heap_state.scavenge_speed_in_bytes_per_ms = 0;
int idle_time_in_ms = 16;
int idle_time_in_ms = 8;
EXPECT_FALSE(GCIdleTimeHandler::ShouldDoScavenge(
idle_time_in_ms, heap_state.new_space_capacity,
heap_state.used_new_space_size, heap_state.scavenge_speed_in_bytes_per_ms,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment