summaryrefslogtreecommitdiffstats
path: root/runtime/gc/collector
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-08-08 17:38:41 -0700
committerMathieu Chartier <mathieuc@google.com>2014-08-08 17:38:41 -0700
commit376fc3caf0f0b9cb63592ff3bac06420f6b13ba8 (patch)
treebe2d900f4430026d546d80e0559f841237a8a178 /runtime/gc/collector
parente74fcc4ba2dc57fb663a81ced62ec950b87f2832 (diff)
downloadart-376fc3caf0f0b9cb63592ff3bac06420f6b13ba8.zip
art-376fc3caf0f0b9cb63592ff3bac06420f6b13ba8.tar.gz
art-376fc3caf0f0b9cb63592ff3bac06420f6b13ba8.tar.bz2
Check pause histogram sample size.
There is a race where the GC sees > 0 iterations but 0 pauses. We now check that there is a non zero number of pauses before printing the pause histogram. Bug: 16898792 Change-Id: I87813e5e6f27871ef79f70792925519d112f3534
Diffstat (limited to 'runtime/gc/collector')
-rw-r--r--runtime/gc/collector/garbage_collector.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc
index 646c032..07b61e6 100644
--- a/runtime/gc/collector/garbage_collector.cc
+++ b/runtime/gc/collector/garbage_collector.cc
@@ -195,9 +195,11 @@ void GarbageCollector::DumpPerformanceInfo(std::ostream& os) {
const uint64_t freed_objects = GetTotalFreedObjects();
{
MutexLock mu(Thread::Current(), pause_histogram_lock_);
- Histogram<uint64_t>::CumulativeData cumulative_data;
- pause_histogram_.CreateHistogram(&cumulative_data);
- pause_histogram_.PrintConfidenceIntervals(os, 0.99, cumulative_data);
+ if (pause_histogram_.SampleSize() > 0) {
+ Histogram<uint64_t>::CumulativeData cumulative_data;
+ pause_histogram_.CreateHistogram(&cumulative_data);
+ pause_histogram_.PrintConfidenceIntervals(os, 0.99, cumulative_data);
+ }
}
os << GetName() << " total time: " << PrettyDuration(total_ns)
<< " mean time: " << PrettyDuration(total_ns / iterations) << "\n"