< prev index next >

src/share/vm/gc/shared/ageTable.cpp

Print this page
rev 11906 : [mq]: 8164936-age-table-print-wrong
rev 11907 : [mq]: 8164936-sangheon-review

*** 25,35 **** #include "precompiled.hpp" #include "gc/shared/ageTable.inline.hpp" #include "gc/shared/ageTableTracer.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectorPolicy.hpp" - #include "gc/shared/gcPolicyCounters.hpp" #include "memory/resourceArea.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "utilities/copy.hpp" --- 25,34 ----
*** 73,84 **** for (int i = 0; i < table_size; i++) { sizes[i]+= subTable->sizes[i]; } } ! uint AgeTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters) { ! size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100); uint result; if (AlwaysTenure || NeverTenure) { assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1, "MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold); --- 72,82 ---- for (int i = 0; i < table_size; i++) { sizes[i]+= subTable->sizes[i]; } } ! uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) { uint result; if (AlwaysTenure || NeverTenure) { assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1, "MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold);
*** 97,128 **** result = age < MaxTenuringThreshold ? age : 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_enabled(Trace, gc, age) || UsePerfData || AgeTableTracer::is_tenuring_distribution_event_enabled()) { size_t total = 0; uint age = 1; while (age < table_size) { size_t wordSize = sizes[age]; total += wordSize; if (wordSize > 0) { log_trace(gc, age)("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", ! age, wordSize*oopSize, total*oopSize); } ! AgeTableTracer::send_tenuring_distribution_event(age, wordSize*oopSize); if (UsePerfData) { ! _perf_sizes[age]->set_value(wordSize*oopSize); } age++; } - if (UsePerfData) { - gc_counters->tenuring_threshold()->set_value(result); - gc_counters->desired_survivor_size()->set_value( - desired_survivor_size*oopSize); - } } - - return result; } --- 95,126 ---- result = age < MaxTenuringThreshold ? age : 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); + return result; + } + + void AgeTable::print_age_table(uint tenuring_threshold) { if (log_is_enabled(Trace, gc, age) || UsePerfData || AgeTableTracer::is_tenuring_distribution_event_enabled()) { + log_trace(gc, age)("Age table with threshold %u (max threshold " UINTX_FORMAT ")", + tenuring_threshold, MaxTenuringThreshold); + size_t total = 0; uint age = 1; while (age < table_size) { size_t wordSize = sizes[age]; total += wordSize; if (wordSize > 0) { log_trace(gc, age)("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", ! age, wordSize * oopSize, total * oopSize); } ! AgeTableTracer::send_tenuring_distribution_event(age, wordSize * oopSize); if (UsePerfData) { ! _perf_sizes[age]->set_value(wordSize * oopSize); } age++; } } } \ No newline at end of file
< prev index next >