There are various types like debugger and GetObjectsAllocated that
can cause spam if we log all the blocking calls. In practice, these
are only used from tools and should not cause jank.
Bug:
37275712
Test: test-art-host
Change-Id: I3a6854d37a6e83c91e9cc8bcb76103e2498bc3b6
// is not the heap task daemon thread, it's considered as a
// blocking GC (i.e., blocking itself).
running_collection_is_blocking_ = true;
- VLOG(gc) << "Starting a blocking GC " << cause;
+ // Don't log fake "GC" types that are only used for debugger or hidden APIs. If we log these,
+ // it results in log spam. kGcCauseExplicit is already logged in LogGC, so avoid it here too.
+ if (cause == kGcCauseForAlloc ||
+ cause == kGcCauseForNativeAlloc ||
+ cause == kGcCauseDisableMovingGc) {
+ VLOG(gc) << "Starting a blocking GC " << cause;
+ }
}
return last_gc_type;
}