From 32c73eae60cb26d7630e5785a5b486c3afad0121 Mon Sep 17 00:00:00 2001 From: ulan Date: Thu, 7 May 2015 05:50:59 -0700 Subject: [PATCH] Do not sample memory histograms in short idle notifications. BUG=chromium:485472 LOG=NO TBR=jochen@chromium.org Review URL: https://codereview.chromium.org/1128363003 Cr-Commit-Position: refs/heads/master@{#28297} --- src/heap/heap.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/heap/heap.cc b/src/heap/heap.cc index 9d8ecda53c..68e1017597 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -4647,14 +4647,17 @@ bool Heap::IdleNotification(double deadline_in_seconds) { GCIdleTimeAction action = gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state); + isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample( static_cast(idle_time_in_ms)); - int committed_memory = static_cast(CommittedMemory() / KB); - int used_memory = static_cast(heap_state.size_of_objects / KB); - isolate()->counters()->aggregated_memory_heap_committed()->AddSample( - start_ms, committed_memory); - isolate()->counters()->aggregated_memory_heap_used()->AddSample(start_ms, - used_memory); + if (is_long_idle_notification) { + int committed_memory = static_cast(CommittedMemory() / KB); + int used_memory = static_cast(heap_state.size_of_objects / KB); + isolate()->counters()->aggregated_memory_heap_committed()->AddSample( + start_ms, committed_memory); + isolate()->counters()->aggregated_memory_heap_used()->AddSample( + start_ms, used_memory); + } bool result = false; switch (action.type) {