summaryrefslogtreecommitdiffstats
path: root/runtime/gc
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-04-11 22:43:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-04-11 22:43:08 +0000
commit248015696ee087878656fb53e37cbf7be2b97e4d (patch)
tree3c5f46f34c36628918317ee8a0caf6acb5ea88fc /runtime/gc
parent37df286803b39fe559dd0fe342a661115d96ae57 (diff)
parentd20aba14a3cb522e933800a164f7dc10eba21da3 (diff)
downloadart-248015696ee087878656fb53e37cbf7be2b97e4d.zip
art-248015696ee087878656fb53e37cbf7be2b97e4d.tar.gz
art-248015696ee087878656fb53e37cbf7be2b97e4d.tar.bz2
Merge "Fix an occasional ThreadStress crash."
Diffstat (limited to 'runtime/gc')
-rw-r--r--runtime/gc/heap.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index efd1c7a..e44ec6a 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -679,7 +679,8 @@ void Heap::DumpGcPerformanceInfo(std::ostream& os) {
for (auto& collector : garbage_collectors_) {
const CumulativeLogger& logger = collector->GetCumulativeTimings();
const size_t iterations = logger.GetIterations();
- if (iterations != 0) {
+ const Histogram<uint64_t>& pause_histogram = collector->GetPauseHistogram();
+ if (iterations != 0 && pause_histogram.SampleSize() != 0) {
os << ConstDumpable<CumulativeLogger>(logger);
const uint64_t total_ns = logger.GetTotalNs();
const uint64_t total_pause_ns = collector->GetTotalPausedTimeNs();
@@ -687,8 +688,8 @@ void Heap::DumpGcPerformanceInfo(std::ostream& os) {
const uint64_t freed_bytes = collector->GetTotalFreedBytes();
const uint64_t freed_objects = collector->GetTotalFreedObjects();
Histogram<uint64_t>::CumulativeData cumulative_data;
- collector->GetPauseHistogram().CreateHistogram(&cumulative_data);
- collector->GetPauseHistogram().PrintConfidenceIntervals(os, 0.99, cumulative_data);
+ pause_histogram.CreateHistogram(&cumulative_data);
+ pause_histogram.PrintConfidenceIntervals(os, 0.99, cumulative_data);
os << collector->GetName() << " total time: " << PrettyDuration(total_ns)
<< " mean time: " << PrettyDuration(total_ns / iterations) << "\n"
<< collector->GetName() << " freed: " << freed_objects
@@ -2796,7 +2797,7 @@ void Heap::RegisterNativeAllocation(JNIEnv* env, int bytes) {
if (IsGcConcurrent()) {
RequestConcurrentGC(self);
} else {
- CollectGarbageInternal(gc_type, kGcCauseForAlloc, false);
+ CollectGarbageInternal(gc_type, kGcCauseForNativeAlloc, false);
}
}
}