Commit 4c6254f4 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[oilpan] Report coalescing time to UMA.

Bug: 
Change-Id: I4f492623358849f6a296bfe7d6c85ffb52b85c73
Reviewed-on: https://chromium-review.googlesource.com/833936
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525290}
parent 17c2f92c
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "platform/heap/HeapPage.h" #include "platform/heap/HeapPage.h"
#include "base/trace_event/process_memory_dump.h" #include "base/trace_event/process_memory_dump.h"
#include "platform/Histogram.h"
#include "platform/MemoryCoordinator.h" #include "platform/MemoryCoordinator.h"
#include "platform/bindings/ScriptForbiddenScope.h" #include "platform/bindings/ScriptForbiddenScope.h"
#include "platform/heap/BlinkGCMemoryDumpProvider.h" #include "platform/heap/BlinkGCMemoryDumpProvider.h"
...@@ -714,6 +715,8 @@ bool NormalPageArena::Coalesce() { ...@@ -714,6 +715,8 @@ bool NormalPageArena::Coalesce() {
DCHECK(!HasCurrentAllocationArea()); DCHECK(!HasCurrentAllocationArea());
TRACE_EVENT0("blink_gc", "BaseArena::coalesce"); TRACE_EVENT0("blink_gc", "BaseArena::coalesce");
double coalesce_start_time = WTF::CurrentTimeTicksInMilliseconds();
// Rebuild free lists. // Rebuild free lists.
free_list_.Clear(); free_list_.Clear();
size_t freed_size = 0; size_t freed_size = 0;
...@@ -769,6 +772,14 @@ bool NormalPageArena::Coalesce() { ...@@ -769,6 +772,14 @@ bool NormalPageArena::Coalesce() {
GetThreadState()->Heap().HeapStats().DecreaseAllocatedObjectSize(freed_size); GetThreadState()->Heap().HeapStats().DecreaseAllocatedObjectSize(freed_size);
DCHECK_EQ(promptly_freed_size_, freed_size); DCHECK_EQ(promptly_freed_size_, freed_size);
promptly_freed_size_ = 0; promptly_freed_size_ = 0;
double coalesce_time =
WTF::CurrentTimeTicksInMilliseconds() - coalesce_start_time;
DEFINE_THREAD_SAFE_STATIC_LOCAL(
CustomCountHistogram, time_for_heap_coalesce_histogram,
("BlinkGC.TimeForCoalesce", 1, 10 * 1000, 50));
time_for_heap_coalesce_histogram.Count(coalesce_time);
return true; return true;
} }
......
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