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

Side by Side Diff: src/heap/gc-tracer.cc

Issue 2322453002: [heap] Add histogram counters to track GC reasons. (Closed)
Patch Set: Add comment Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/counters.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/gc-tracer.h" 5 #include "src/heap/gc-tracer.h"
6 6
7 #include "src/counters.h" 7 #include "src/counters.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 10
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 cumulative_incremental_marking_bytes_; 198 cumulative_incremental_marking_bytes_;
199 current_.cumulative_pure_incremental_marking_duration = 199 current_.cumulative_pure_incremental_marking_duration =
200 cumulative_pure_incremental_marking_duration_; 200 cumulative_pure_incremental_marking_duration_;
201 201
202 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { 202 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) {
203 current_.scopes[i] = 0; 203 current_.scopes[i] = 0;
204 } 204 }
205 205
206 int committed_memory = static_cast<int>(heap_->CommittedMemory() / KB); 206 int committed_memory = static_cast<int>(heap_->CommittedMemory() / KB);
207 int used_memory = static_cast<int>(current_.start_object_size / KB); 207 int used_memory = static_cast<int>(current_.start_object_size / KB);
208 heap_->isolate()->counters()->aggregated_memory_heap_committed()->AddSample( 208
209 start_time, committed_memory); 209 Counters* counters = heap_->isolate()->counters();
210 heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample( 210
211 start_time, used_memory); 211 if (collector == SCAVENGER) {
212 counters->scavenge_reason()->AddSample(static_cast<int>(gc_reason));
213 } else {
214 counters->mark_compact_reason()->AddSample(static_cast<int>(gc_reason));
215 }
216 counters->aggregated_memory_heap_committed()->AddSample(start_time,
217 committed_memory);
218 counters->aggregated_memory_heap_used()->AddSample(start_time, used_memory);
212 // TODO(cbruni): remove once we fully moved to a trace-based system. 219 // TODO(cbruni): remove once we fully moved to a trace-based system.
213 if (FLAG_runtime_call_stats) { 220 if (FLAG_runtime_call_stats) {
214 RuntimeCallStats::Enter(heap_->isolate()->counters()->runtime_call_stats(), 221 RuntimeCallStats::Enter(heap_->isolate()->counters()->runtime_call_stats(),
215 &timer_, &RuntimeCallStats::GC); 222 &timer_, &RuntimeCallStats::GC);
216 } 223 }
217 // TODO(lpy): Add a tracing equivalent for the runtime call stats. 224 // TODO(lpy): Add a tracing equivalent for the runtime call stats.
218 } 225 }
219 226
220 void GCTracer::MergeBaseline(const Event& baseline) { 227 void GCTracer::MergeBaseline(const Event& baseline) {
221 current_.incremental_marking_bytes = 228 current_.incremental_marking_bytes =
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 } 834 }
828 835
829 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } 836 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); }
830 837
831 void GCTracer::NotifyIncrementalMarkingStart() { 838 void GCTracer::NotifyIncrementalMarkingStart() {
832 incremental_marking_start_time_ = heap_->MonotonicallyIncreasingTimeInMs(); 839 incremental_marking_start_time_ = heap_->MonotonicallyIncreasingTimeInMs();
833 } 840 }
834 841
835 } // namespace internal 842 } // namespace internal
836 } // namespace v8 843 } // namespace v8
OLDNEW
« no previous file with comments | « src/counters.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698