< prev index next >

src/share/vm/gc/cms/parNewGeneration.cpp

Print this page

        

*** 43,52 **** --- 43,53 ---- #include "gc/shared/space.hpp" #include "gc/shared/spaceDecorator.hpp" #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" #include "gc/shared/workgroup.hpp" + #include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/handles.hpp"
*** 296,310 **** void reset(uint active_workers, bool promotion_failed); void flush(); #if TASKQUEUE_STATS static void ! print_termination_stats_hdr(outputStream* const st = gclog_or_tty); ! void print_termination_stats(outputStream* const st = gclog_or_tty); static void ! print_taskqueue_stats_hdr(outputStream* const st = gclog_or_tty); ! void print_taskqueue_stats(outputStream* const st = gclog_or_tty); void reset_stats(); #endif // TASKQUEUE_STATS private: ParallelTaskTerminator& _term; --- 297,311 ---- void reset(uint active_workers, bool promotion_failed); void flush(); #if TASKQUEUE_STATS static void ! print_termination_stats_hdr(outputStream* const st); ! void print_termination_stats(); static void ! print_taskqueue_stats_hdr(outputStream* const st); ! void print_taskqueue_stats(); void reset_stats(); #endif // TASKQUEUE_STATS private: ParallelTaskTerminator& _term;
*** 381,391 **** st->print_raw_cr(" elapsed --strong roots-- -------termination-------"); st->print_raw_cr("thr ms ms % ms % attempts"); st->print_raw_cr("--- --------- --------- ------ --------- ------ --------"); } ! void ParScanThreadStateSet::print_termination_stats(outputStream* const st) { print_termination_stats_hdr(st); for (int i = 0; i < length(); ++i) { const ParScanThreadState & pss = thread_state(i); const double elapsed_ms = pss.elapsed_time() * 1000.0; --- 382,400 ---- st->print_raw_cr(" elapsed --strong roots-- -------termination-------"); st->print_raw_cr("thr ms ms % ms % attempts"); st->print_raw_cr("--- --------- --------- ------ --------- ------ --------"); } ! void ParScanThreadStateSet::print_termination_stats() { ! LogHandle(gc, task, stats) log; ! if (!log.is_debug()) { ! return; ! } ! ! ResourceMark rm; ! outputStream* st = log.debug_stream(); ! print_termination_stats_hdr(st); for (int i = 0; i < length(); ++i) { const ParScanThreadState & pss = thread_state(i); const double elapsed_ms = pss.elapsed_time() * 1000.0;
*** 402,412 **** st->print_raw_cr("GC Task Stats"); st->print_raw("thr "); TaskQueueStats::print_header(1, st); st->cr(); st->print_raw("--- "); TaskQueueStats::print_header(2, st); st->cr(); } ! void ParScanThreadStateSet::print_taskqueue_stats(outputStream* const st) { print_taskqueue_stats_hdr(st); TaskQueueStats totals; for (int i = 0; i < length(); ++i) { const ParScanThreadState & pss = thread_state(i); --- 411,427 ---- st->print_raw_cr("GC Task Stats"); st->print_raw("thr "); TaskQueueStats::print_header(1, st); st->cr(); st->print_raw("--- "); TaskQueueStats::print_header(2, st); st->cr(); } ! void ParScanThreadStateSet::print_taskqueue_stats() { ! LogHandle(gc, task, stats) log; ! if (!log.is_develop()) { ! return; ! } ! ResourceMark rm; ! outputStream* st = log.develop_stream(); print_taskqueue_stats_hdr(st); TaskQueueStats totals; for (int i = 0; i < length(); ++i) { const ParScanThreadState & pss = thread_state(i);
*** 880,892 **** if (UseAdaptiveSizePolicy) { set_survivor_overflow(false); size_policy->minor_collection_begin(); } ! GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); ! // Capture heap used before collection (for printing). ! size_t gch_prev_used = gch->used(); age_table()->clear(); to()->clear(SpaceDecorator::Mangle); gch->save_marks(); --- 895,905 ---- if (UseAdaptiveSizePolicy) { set_survivor_overflow(false); size_policy->minor_collection_begin(); } ! GCTraceTime(Trace, gc) t1("ParNew", NULL, gch->gc_cause()); age_table()->clear(); to()->clear(SpaceDecorator::Mangle); gch->save_marks();
*** 988,1003 **** if (ResizePLAB) { plab_stats()->adjust_desired_plab_sz(); } ! if (PrintGC && !PrintGCDetails) { ! gch->print_heap_change(gch_prev_used); ! } ! ! TASKQUEUE_STATS_ONLY(if (PrintTerminationStats) thread_state_set.print_termination_stats()); ! TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) thread_state_set.print_taskqueue_stats()); if (UseAdaptiveSizePolicy) { size_policy->minor_collection_end(gch->gc_cause()); size_policy->avg_survived()->sample(from()->used()); } --- 1001,1012 ---- if (ResizePLAB) { plab_stats()->adjust_desired_plab_sz(); } ! TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats()); ! TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats()); if (UseAdaptiveSizePolicy) { size_policy->minor_collection_end(gch->gc_cause()); size_policy->avg_survived()->sample(from()->used()); }
*** 1146,1164 **** new_obj->incr_age(); par_scan_state->age_table()->add(new_obj, sz); } assert(new_obj != NULL, "just checking"); - #ifndef PRODUCT // This code must come after the CAS test, or it will print incorrect // information. ! if (TraceScavenge) { ! gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", is_in_reserved(new_obj) ? "copying" : "tenuring", new_obj->klass()->internal_name(), p2i(old), p2i(new_obj), new_obj->size()); - } - #endif if (forward_ptr == NULL) { oop obj_to_push = new_obj; if (par_scan_state->should_be_partially_scanned(obj_to_push, old)) { // Length field used as index of next element to be scanned. --- 1155,1169 ---- new_obj->incr_age(); par_scan_state->age_table()->add(new_obj, sz); } assert(new_obj != NULL, "just checking"); // This code must come after the CAS test, or it will print incorrect // information. ! log_develop(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", is_in_reserved(new_obj) ? "copying" : "tenuring", new_obj->klass()->internal_name(), p2i(old), p2i(new_obj), new_obj->size()); if (forward_ptr == NULL) { oop obj_to_push = new_obj; if (par_scan_state->should_be_partially_scanned(obj_to_push, old)) { // Length field used as index of next element to be scanned.
< prev index next >