--- old/src/share/vm/gc/shared/ageTable.cpp 2015-11-19 15:35:18.282128878 +0100 +++ new/src/share/vm/gc/shared/ageTable.cpp 2015-11-19 15:35:18.166128882 +0100 @@ -28,6 +28,7 @@ #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcPolicyCounters.hpp" #include "memory/resourceArea.hpp" +#include "logging/log.hpp" #include "utilities/copy.hpp" /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. @@ -94,24 +95,18 @@ result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold; } - if (PrintTenuringDistribution || UsePerfData) { - if (PrintTenuringDistribution) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold " - UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", - desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); - } + log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold " UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", + desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); + if (Log::is_trace() || UsePerfData) { size_t total = 0; uint age = 1; while (age < table_size) { total += sizes[age]; if (sizes[age] > 0) { - if (PrintTenuringDistribution) { - gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", - age, sizes[age]*oopSize, total*oopSize); - } + log_trace(gc, age)("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", + age, sizes[age]*oopSize, total*oopSize); } if (UsePerfData) { _perf_sizes[age]->set_value(sizes[age]*oopSize);