Reviewers: Hannes Payer,

Message:
PTAL

Description:
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

Please review this at https://codereview.chromium.org/1280623002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -1 lines):
  M src/heap/memory-reducer.cc


Index: src/heap/memory-reducer.cc
diff --git a/src/heap/memory-reducer.cc b/src/heap/memory-reducer.cc
index 634c625755dbe611fe103dd270ed3509a6cf4cde..25378b59112a0584cb4f6e750f0719becd66170f 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() &&


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to