Warn if a GC takes > 100ms, even if -verbose:gc isn't on.
I haven't actually seen this in practice, but it does mean we can
rule GC out if we notice a pause and there's no GC logging. This might
also be useful if we change the launcher so apps aren't all launched
with -verbose:gc, as seems likely to happen eventually.
Change-Id: I06eba14740307eb75f70a4fab1f81443d18ebc3a
diff --git a/src/heap.cc b/src/heap.cc
index 6b0677c..fe51d48 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -543,7 +543,8 @@
size_t percentFree = 100 - static_cast<size_t>(100.0f * float(num_bytes_allocated_) / total);
uint32_t duration = (t1 - t0)/1000/1000;
- if (Heap::IsVerboseGc()) {
+ bool gc_was_particularly_slow = (duration > 100); // TODO: crank this down for concurrent.
+ if (Heap::IsVerboseGc() || gc_was_particularly_slow) {
LOG(INFO) << "GC freed " << (is_small ? "<" : "") << kib_freed << "KiB, "
<< percentFree << "% free "
<< (num_bytes_allocated_/1024) << "KiB/" << (total/1024) << "KiB, "