The following is logged with the trace level, but debug_stream() is called instead of trace_stream()
LogHandle(gc) log;
if (log.is_trace() && stats().valid()) {
log.trace("CMSCollector shouldConcurrentCollect: ");
ResourceMark rm;
stats().print_on(log.debug_stream());
log.trace("time_until_cms_gen_full %3.7f", stats().time_until_cms_gen_full());
log.trace("free=" SIZE_FORMAT, _cmsGen->free());
log.trace("contiguous_available=" SIZE_FORMAT, _cmsGen->contiguous_available());
log.trace("promotion_rate=%g", stats().promotion_rate());
log.trace("cms_allocation_rate=%g", stats().cms_allocation_rate());
log.trace("occupancy=%3.7f", _cmsGen->occupancy());
log.trace("initiatingOccupancy=%3.7f", _cmsGen->initiating_occupancy());
log.trace("cms_time_since_begin=%3.7f", stats().cms_time_since_begin());
log.trace("cms_time_since_end=%3.7f", stats().cms_time_since_end());
log.trace("metadata initialized %d", MetaspaceGC::should_concurrent_collect());
}
LogHandle(gc) log;
if (log.is_trace() && stats().valid()) {
log.trace("CMSCollector shouldConcurrentCollect: ");
ResourceMark rm;
stats().print_on(log.debug_stream());
log.trace("time_until_cms_gen_full %3.7f", stats().time_until_cms_gen_full());
log.trace("free=" SIZE_FORMAT, _cmsGen->free());
log.trace("contiguous_available=" SIZE_FORMAT, _cmsGen->contiguous_available());
log.trace("promotion_rate=%g", stats().promotion_rate());
log.trace("cms_allocation_rate=%g", stats().cms_allocation_rate());
log.trace("occupancy=%3.7f", _cmsGen->occupancy());
log.trace("initiatingOccupancy=%3.7f", _cmsGen->initiating_occupancy());
log.trace("cms_time_since_begin=%3.7f", stats().cms_time_since_begin());
log.trace("cms_time_since_end=%3.7f", stats().cms_time_since_end());
log.trace("metadata initialized %d", MetaspaceGC::should_concurrent_collect());
}