Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: src/heap/gc-tracer.cc

Issue 1125683004: Add aggregated memory histograms. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/counters.h ('K') | « src/flag-definitions.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index f545b2f134f275811110709f123a6cc7a1efdb6b..1c5226d6c4796d8b663b4912700bccc9feaaca24 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -113,7 +113,7 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
if (start_counter_ != 1) return;
previous_ = current_;
- double start_time = base::OS::TimeCurrentMillis();
+ double start_time = heap_->MonotonicallyIncreasingTimeInMs();
if (new_space_top_after_gc_ != 0) {
AddNewSpaceAllocationTime(
start_time - previous_.end_time,
@@ -154,6 +154,12 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) {
current_.scopes[i] = 0;
}
+ int committed_memory = static_cast<int>(heap_->CommittedMemory() / KB);
+ int used_memory = static_cast<int>(current_.start_object_size / KB);
+ heap_->isolate()->counters()->aggregated_memory_heap_committed()->AddSample(
+ start_time, committed_memory);
+ heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample(
+ start_time, used_memory);
}
@@ -174,13 +180,20 @@ void GCTracer::Stop(GarbageCollector collector) {
(current_.type == Event::MARK_COMPACTOR ||
current_.type == Event::INCREMENTAL_MARK_COMPACTOR)));
- current_.end_time = base::OS::TimeCurrentMillis();
+ current_.end_time = heap_->MonotonicallyIncreasingTimeInMs();
current_.end_object_size = heap_->SizeOfObjects();
current_.end_memory_size = heap_->isolate()->memory_allocator()->Size();
current_.end_holes_size = CountTotalHolesSize(heap_);
new_space_top_after_gc_ =
reinterpret_cast<intptr_t>(heap_->new_space()->top());
+ int committed_memory = static_cast<int>(heap_->CommittedMemory() / KB);
+ int used_memory = static_cast<int>(current_.end_object_size / KB);
+ heap_->isolate()->counters()->aggregated_memory_heap_committed()->AddSample(
+ current_.end_time, committed_memory);
+ heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample(
+ current_.end_time, used_memory);
+
if (current_.type == Event::SCAVENGER) {
current_.incremental_marking_steps =
current_.cumulative_incremental_marking_steps -
« src/counters.h ('K') | « src/flag-definitions.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698