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

Unified Diff: src/heap/heap.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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 83fb6394f96e500027120929fbe70b93a438209b..0697043b7db01a9a6fdeeac546922cd22fbaa3a4 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4577,7 +4577,7 @@ bool Heap::TryFinalizeIdleIncrementalMarking(
}
-static double MonotonicallyIncreasingTimeInMs() {
+double Heap::MonotonicallyIncreasingTimeInMs() {
return V8::GetCurrentPlatform()->MonotonicallyIncreasingTime() *
static_cast<double>(base::Time::kMillisecondsPerSecond);
}
@@ -4598,7 +4598,8 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
static_cast<double>(base::Time::kMillisecondsPerSecond);
HistogramTimerScope idle_notification_scope(
isolate_->counters()->gc_idle_notification());
- double idle_time_in_ms = deadline_in_ms - MonotonicallyIncreasingTimeInMs();
+ double start_ms = MonotonicallyIncreasingTimeInMs();
+ double idle_time_in_ms = deadline_in_ms - start_ms;
bool is_long_idle_notification =
static_cast<size_t>(idle_time_in_ms) >
GCIdleTimeHandler::kMaxFrameRenderingIdleTime;
@@ -4642,6 +4643,12 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state);
isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
static_cast<int>(idle_time_in_ms));
+ int committed_memory = static_cast<int>(CommittedMemory() / KB);
+ int used_memory = static_cast<int>(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) {
« src/counters.h ('K') | « src/heap/heap.h ('k') | test/unittests/counters-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698