Sample allocation rate in memory reducer.
authorulan <ulan@chromium.org>
Fri, 7 Aug 2015 09:24:21 +0000 (02:24 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 7 Aug 2015 09:24:38 +0000 (09:24 +0000)
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

index 634c625..25378b5 100644 (file)
@@ -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() &&