From ddcec9f6bf50779bc23bf43b731c0699cc19c4ea Mon Sep 17 00:00:00 2001 From: ulan Date: Fri, 7 Aug 2015 02:24:21 -0700 Subject: [PATCH] Sample allocation rate in memory reducer. Otherwise, if there is no GC and no idle notification, memory reducer will use old allocation rate. BUG=chromium:515873 LOG=NO Review URL: https://codereview.chromium.org/1280623002 Cr-Commit-Position: refs/heads/master@{#30059} --- src/heap/memory-reducer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/heap/memory-reducer.cc b/src/heap/memory-reducer.cc index 634c625..25378b5 100644 --- a/src/heap/memory-reducer.cc +++ b/src/heap/memory-reducer.cc @@ -25,8 +25,11 @@ MemoryReducer::TimerTask::TimerTask(MemoryReducer* memory_reducer) void MemoryReducer::TimerTask::RunInternal() { Heap* heap = memory_reducer_->heap(); Event event; + double time_ms = heap->MonotonicallyIncreasingTimeInMs(); + heap->tracer()->SampleAllocation(time_ms, heap->NewSpaceAllocationCounter(), + heap->OldGenerationAllocationCounter()); event.type = kTimer; - event.time_ms = heap->MonotonicallyIncreasingTimeInMs(); + event.time_ms = time_ms; event.low_allocation_rate = heap->HasLowAllocationRate(); event.can_start_incremental_gc = heap->incremental_marking()->IsStopped() && -- 2.7.4