diff options
author | 2016-05-17 16:37:53 +0600 | |
---|---|---|
committer | 2016-05-24 11:55:47 +0600 | |
commit | 3e80aeb449d0ae09f6a34b5a15727ccbfe38eb70 (patch) | |
tree | ebda793d2853d4d05a34c0215f3222f260d4e224 | |
parent | df92503d788cc0340dcf296525416535cc34d7c9 (diff) |
ART: Print jit memory use only if we have samples
Otherwise we got crashes on sigquit/shutdown trying to dump
JIT statistics when the histograms are empty.
Change-Id: Iac3ab5b51121f9bb5656f6ef71af785706541288
Signed-off-by: Pavel Vyssotski <pavel.n.vyssotski@intel.com>
-rw-r--r-- | runtime/base/histogram-inl.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/base/histogram-inl.h b/runtime/base/histogram-inl.h index c7a0ba2dfd..4af47d170a 100644 --- a/runtime/base/histogram-inl.h +++ b/runtime/base/histogram-inl.h @@ -202,9 +202,13 @@ inline void Histogram<Value>::PrintConfidenceIntervals(std::ostream &os, double template <class Value> inline void Histogram<Value>::PrintMemoryUse(std::ostream &os) const { - os << Name() - << ": Avg: " << PrettySize(Mean()) << " Max: " - << PrettySize(Max()) << " Min: " << PrettySize(Min()) << "\n"; + os << Name(); + if (sample_size_ != 0u) { + os << ": Avg: " << PrettySize(Mean()) << " Max: " + << PrettySize(Max()) << " Min: " << PrettySize(Min()) << "\n"; + } else { + os << ": <no data>\n"; + } } template <class Value> |