42 #include "gc/g1/heapRegionSet.inline.hpp" |
40 #include "gc/g1/heapRegionSet.inline.hpp" |
43 #include "gc/g1/suspendibleThreadSet.hpp" |
41 #include "gc/g1/suspendibleThreadSet.hpp" |
44 #include "gc/shared/gcId.hpp" |
42 #include "gc/shared/gcId.hpp" |
45 #include "gc/shared/gcTimer.hpp" |
43 #include "gc/shared/gcTimer.hpp" |
46 #include "gc/shared/gcTrace.hpp" |
44 #include "gc/shared/gcTrace.hpp" |
47 #include "gc/shared/gcTraceTime.hpp" |
45 #include "gc/shared/gcTraceTime.inline.hpp" |
48 #include "gc/shared/genOopClosures.inline.hpp" |
46 #include "gc/shared/genOopClosures.inline.hpp" |
49 #include "gc/shared/referencePolicy.hpp" |
47 #include "gc/shared/referencePolicy.hpp" |
50 #include "gc/shared/strongRootsScope.hpp" |
48 #include "gc/shared/strongRootsScope.hpp" |
51 #include "gc/shared/taskqueue.inline.hpp" |
49 #include "gc/shared/taskqueue.inline.hpp" |
52 #include "gc/shared/vmGCOperations.hpp" |
50 #include "gc/shared/vmGCOperations.hpp" |
|
51 #include "logging/log.hpp" |
53 #include "memory/allocation.hpp" |
52 #include "memory/allocation.hpp" |
54 #include "memory/resourceArea.hpp" |
53 #include "memory/resourceArea.hpp" |
55 #include "oops/oop.inline.hpp" |
54 #include "oops/oop.inline.hpp" |
56 #include "runtime/atomic.inline.hpp" |
55 #include "runtime/atomic.inline.hpp" |
57 #include "runtime/handles.inline.hpp" |
56 #include "runtime/handles.inline.hpp" |
985 } |
976 } |
986 } |
977 } |
987 }; |
978 }; |
988 |
979 |
989 void ConcurrentMark::scanRootRegions() { |
980 void ConcurrentMark::scanRootRegions() { |
990 double scan_start = os::elapsedTime(); |
|
991 |
|
992 // Start of concurrent marking. |
981 // Start of concurrent marking. |
993 ClassLoaderDataGraph::clear_claimed_marks(); |
982 ClassLoaderDataGraph::clear_claimed_marks(); |
994 |
983 |
995 // scan_in_progress() will have been set to true only if there was |
984 // scan_in_progress() will have been set to true only if there was |
996 // at least one root region to scan. So, if it's false, we |
985 // at least one root region to scan. So, if it's false, we |
997 // should not attempt to do any further work. |
986 // should not attempt to do any further work. |
998 if (root_regions()->scan_in_progress()) { |
987 if (root_regions()->scan_in_progress()) { |
999 if (G1Log::fine()) { |
988 GCTraceConcTime(Info, gc) tt("Concurrent Root Region Scan"); |
1000 gclog_or_tty->gclog_stamp(); |
|
1001 gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]"); |
|
1002 } |
|
1003 |
989 |
1004 _parallel_marking_threads = calc_parallel_marking_threads(); |
990 _parallel_marking_threads = calc_parallel_marking_threads(); |
1005 assert(parallel_marking_threads() <= max_parallel_marking_threads(), |
991 assert(parallel_marking_threads() <= max_parallel_marking_threads(), |
1006 "Maximum number of marking threads exceeded"); |
992 "Maximum number of marking threads exceeded"); |
1007 uint active_workers = MAX2(1U, parallel_marking_threads()); |
993 uint active_workers = MAX2(1U, parallel_marking_threads()); |
1008 |
994 |
1009 CMRootRegionScanTask task(this); |
995 CMRootRegionScanTask task(this); |
1010 _parallel_workers->set_active_workers(active_workers); |
996 _parallel_workers->set_active_workers(active_workers); |
1011 _parallel_workers->run_task(&task); |
997 _parallel_workers->run_task(&task); |
1012 |
|
1013 if (G1Log::fine()) { |
|
1014 gclog_or_tty->gclog_stamp(); |
|
1015 gclog_or_tty->print_cr("[GC concurrent-root-region-scan-end, %1.7lf secs]", os::elapsedTime() - scan_start); |
|
1016 } |
|
1017 |
998 |
1018 // It's possible that has_aborted() is true here without actually |
999 // It's possible that has_aborted() is true here without actually |
1019 // aborting the survivor scan earlier. This is OK as it's |
1000 // aborting the survivor scan earlier. This is OK as it's |
1020 // mainly used for sanity checking. |
1001 // mainly used for sanity checking. |
1021 root_regions()->scan_finished(); |
1002 root_regions()->scan_finished(); |
1100 weakRefsWork(clear_all_soft_refs); |
1064 weakRefsWork(clear_all_soft_refs); |
1101 |
1065 |
1102 if (has_overflown()) { |
1066 if (has_overflown()) { |
1103 // Oops. We overflowed. Restart concurrent marking. |
1067 // Oops. We overflowed. Restart concurrent marking. |
1104 _restart_for_overflow = true; |
1068 _restart_for_overflow = true; |
1105 if (G1TraceMarkStackOverflow) { |
1069 log_develop_trace(gc)("Remark led to restart for overflow."); |
1106 gclog_or_tty->print_cr("\nRemark led to restart for overflow."); |
|
1107 } |
|
1108 |
1070 |
1109 // Verify the heap w.r.t. the previous marking bitmap. |
1071 // Verify the heap w.r.t. the previous marking bitmap. |
1110 if (VerifyDuringGC) { |
1072 if (VerifyDuringGC) { |
1111 HandleMark hm; // handle scope |
1073 HandleMark hm; // handle scope |
1112 g1h->prepare_for_verify(); |
1074 g1h->prepare_for_verify(); |
1113 Universe::verify(VerifyOption_G1UsePrevMarking, |
1075 Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (overflow)"); |
1114 " VerifyDuringGC:(overflow)"); |
|
1115 } |
1076 } |
1116 |
1077 |
1117 // Clear the marking state because we will be restarting |
1078 // Clear the marking state because we will be restarting |
1118 // marking due to overflowing the global mark stack. |
1079 // marking due to overflowing the global mark stack. |
1119 reset_marking_state(); |
1080 reset_marking_state(); |
1120 } else { |
1081 } else { |
1121 { |
1082 { |
1122 G1CMTraceTime trace("GC aggregate-data", G1Log::finer()); |
1083 GCTraceTime(Debug, gc) trace("GC Aggregate Data", g1h->gc_timer_cm()); |
1123 |
1084 |
1124 // Aggregate the per-task counting data that we have accumulated |
1085 // Aggregate the per-task counting data that we have accumulated |
1125 // while marking. |
1086 // while marking. |
1126 aggregate_count_data(); |
1087 aggregate_count_data(); |
1127 } |
1088 } |
1741 |
1700 |
1742 // Statistics. |
1701 // Statistics. |
1743 double end = os::elapsedTime(); |
1702 double end = os::elapsedTime(); |
1744 _cleanup_times.add((end - start) * 1000.0); |
1703 _cleanup_times.add((end - start) * 1000.0); |
1745 |
1704 |
1746 if (G1Log::fine()) { |
|
1747 g1h->g1_policy()->print_heap_transition(start_used_bytes); |
|
1748 } |
|
1749 |
|
1750 // Clean up will have freed any regions completely full of garbage. |
1705 // Clean up will have freed any regions completely full of garbage. |
1751 // Update the soft reference policy with the new heap occupancy. |
1706 // Update the soft reference policy with the new heap occupancy. |
1752 Universe::update_heap_info_at_gc(); |
1707 Universe::update_heap_info_at_gc(); |
1753 |
1708 |
1754 if (VerifyDuringGC) { |
1709 if (VerifyDuringGC) { |
1755 HandleMark hm; // handle scope |
1710 HandleMark hm; // handle scope |
1756 g1h->prepare_for_verify(); |
1711 g1h->prepare_for_verify(); |
1757 Universe::verify(VerifyOption_G1UsePrevMarking, |
1712 Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (after)"); |
1758 " VerifyDuringGC:(after)"); |
|
1759 } |
1713 } |
1760 |
1714 |
1761 g1h->check_bitmaps("Cleanup End"); |
1715 g1h->check_bitmaps("Cleanup End"); |
1762 |
1716 |
1763 g1h->verify_region_sets_optional(); |
1717 g1h->verify_region_sets_optional(); |
1808 // we do during this process. We'll also append the local list when |
1760 // we do during this process. We'll also append the local list when |
1809 // _cleanup_list is empty (which means we just removed the last |
1761 // _cleanup_list is empty (which means we just removed the last |
1810 // region from the _cleanup_list). |
1762 // region from the _cleanup_list). |
1811 if ((tmp_free_list.length() % G1SecondaryFreeListAppendLength == 0) || |
1763 if ((tmp_free_list.length() % G1SecondaryFreeListAppendLength == 0) || |
1812 _cleanup_list.is_empty()) { |
1764 _cleanup_list.is_empty()) { |
1813 if (G1ConcRegionFreeingVerbose) { |
1765 log_develop_trace(gc, freelist)("G1ConcRegionFreeing [complete cleanup] : " |
1814 gclog_or_tty->print_cr("G1ConcRegionFreeing [complete cleanup] : " |
1766 "appending %u entries to the secondary_free_list, " |
1815 "appending %u entries to the secondary_free_list, " |
1767 "cleanup list still has %u entries", |
1816 "cleanup list still has %u entries", |
1768 tmp_free_list.length(), |
1817 tmp_free_list.length(), |
1769 _cleanup_list.length()); |
1818 _cleanup_list.length()); |
|
1819 } |
|
1820 |
1770 |
1821 { |
1771 { |
1822 MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); |
1772 MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); |
1823 g1h->secondary_free_list_add(&tmp_free_list); |
1773 g1h->secondary_free_list_add(&tmp_free_list); |
1824 SecondaryFreeList_lock->notify_all(); |
1774 SecondaryFreeList_lock->notify_all(); |
2161 |
2111 |
2162 assert(_markStack.isEmpty(), "Marking should have completed"); |
2112 assert(_markStack.isEmpty(), "Marking should have completed"); |
2163 |
2113 |
2164 // Unload Klasses, String, Symbols, Code Cache, etc. |
2114 // Unload Klasses, String, Symbols, Code Cache, etc. |
2165 { |
2115 { |
2166 G1CMTraceTime trace("Unloading", G1Log::finer()); |
2116 GCTraceTime(Debug, gc) trace("Unloading", g1h->gc_timer_cm()); |
2167 |
2117 |
2168 if (ClassUnloadingWithConcurrentMark) { |
2118 if (ClassUnloadingWithConcurrentMark) { |
2169 bool purged_classes; |
2119 bool purged_classes; |
2170 |
2120 |
2171 { |
2121 { |
2172 G1CMTraceTime trace("System Dictionary Unloading", G1Log::finest()); |
2122 GCTraceTime(Trace, gc) trace("System Dictionary Unloading", g1h->gc_timer_cm()); |
2173 purged_classes = SystemDictionary::do_unloading(&g1_is_alive, false /* Defer klass cleaning */); |
2123 purged_classes = SystemDictionary::do_unloading(&g1_is_alive, false /* Defer klass cleaning */); |
2174 } |
2124 } |
2175 |
2125 |
2176 { |
2126 { |
2177 G1CMTraceTime trace("Parallel Unloading", G1Log::finest()); |
2127 GCTraceTime(Trace, gc) trace("Parallel Unloading", g1h->gc_timer_cm()); |
2178 weakRefsWorkParallelPart(&g1_is_alive, purged_classes); |
2128 weakRefsWorkParallelPart(&g1_is_alive, purged_classes); |
2179 } |
2129 } |
2180 } |
2130 } |
2181 |
2131 |
2182 if (G1StringDedup::is_enabled()) { |
2132 if (G1StringDedup::is_enabled()) { |
2183 G1CMTraceTime trace("String Deduplication Unlink", G1Log::finest()); |
2133 GCTraceTime(Trace, gc) trace("String Deduplication Unlink", g1h->gc_timer_cm()); |
2184 G1StringDedup::unlink(&g1_is_alive); |
2134 G1StringDedup::unlink(&g1_is_alive); |
2185 } |
2135 } |
2186 } |
2136 } |
2187 } |
2137 } |
2188 |
2138 |
2661 _g1h->register_concurrent_cycle_end(); |
2612 _g1h->register_concurrent_cycle_end(); |
2662 } |
2613 } |
2663 |
2614 |
2664 static void print_ms_time_info(const char* prefix, const char* name, |
2615 static void print_ms_time_info(const char* prefix, const char* name, |
2665 NumberSeq& ns) { |
2616 NumberSeq& ns) { |
2666 gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", |
2617 log_trace(gc, marking)("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", |
2667 prefix, ns.num(), name, ns.sum()/1000.0, ns.avg()); |
2618 prefix, ns.num(), name, ns.sum()/1000.0, ns.avg()); |
2668 if (ns.num() > 0) { |
2619 if (ns.num() > 0) { |
2669 gclog_or_tty->print_cr("%s [std. dev = %8.2f ms, max = %8.2f ms]", |
2620 log_trace(gc, marking)("%s [std. dev = %8.2f ms, max = %8.2f ms]", |
2670 prefix, ns.sd(), ns.maximum()); |
2621 prefix, ns.sd(), ns.maximum()); |
2671 } |
2622 } |
2672 } |
2623 } |
2673 |
2624 |
2674 void ConcurrentMark::print_summary_info() { |
2625 void ConcurrentMark::print_summary_info() { |
2675 gclog_or_tty->print_cr(" Concurrent marking:"); |
2626 LogHandle(gc, marking) log; |
|
2627 if (!log.is_trace()) { |
|
2628 return; |
|
2629 } |
|
2630 |
|
2631 log.trace(" Concurrent marking:"); |
2676 print_ms_time_info(" ", "init marks", _init_times); |
2632 print_ms_time_info(" ", "init marks", _init_times); |
2677 print_ms_time_info(" ", "remarks", _remark_times); |
2633 print_ms_time_info(" ", "remarks", _remark_times); |
2678 { |
2634 { |
2679 print_ms_time_info(" ", "final marks", _remark_mark_times); |
2635 print_ms_time_info(" ", "final marks", _remark_mark_times); |
2680 print_ms_time_info(" ", "weak refs", _remark_weak_ref_times); |
2636 print_ms_time_info(" ", "weak refs", _remark_weak_ref_times); |
2681 |
2637 |
2682 } |
2638 } |
2683 print_ms_time_info(" ", "cleanups", _cleanup_times); |
2639 print_ms_time_info(" ", "cleanups", _cleanup_times); |
2684 gclog_or_tty->print_cr(" Final counting total time = %8.2f s (avg = %8.2f ms).", |
2640 log.trace(" Final counting total time = %8.2f s (avg = %8.2f ms).", |
2685 _total_counting_time, |
2641 _total_counting_time, (_cleanup_times.num() > 0 ? _total_counting_time * 1000.0 / (double)_cleanup_times.num() : 0.0)); |
2686 (_cleanup_times.num() > 0 ? _total_counting_time * 1000.0 / |
|
2687 (double)_cleanup_times.num() |
|
2688 : 0.0)); |
|
2689 if (G1ScrubRemSets) { |
2642 if (G1ScrubRemSets) { |
2690 gclog_or_tty->print_cr(" RS scrub total time = %8.2f s (avg = %8.2f ms).", |
2643 log.trace(" RS scrub total time = %8.2f s (avg = %8.2f ms).", |
2691 _total_rs_scrub_time, |
2644 _total_rs_scrub_time, (_cleanup_times.num() > 0 ? _total_rs_scrub_time * 1000.0 / (double)_cleanup_times.num() : 0.0)); |
2692 (_cleanup_times.num() > 0 ? _total_rs_scrub_time * 1000.0 / |
2645 } |
2693 (double)_cleanup_times.num() |
2646 log.trace(" Total stop_world time = %8.2f s.", |
2694 : 0.0)); |
2647 (_init_times.sum() + _remark_times.sum() + _cleanup_times.sum())/1000.0); |
2695 } |
2648 log.trace(" Total concurrent time = %8.2f s (%8.2f s marking).", |
2696 gclog_or_tty->print_cr(" Total stop_world time = %8.2f s.", |
2649 cmThread()->vtime_accum(), cmThread()->vtime_mark_accum()); |
2697 (_init_times.sum() + _remark_times.sum() + |
|
2698 _cleanup_times.sum())/1000.0); |
|
2699 gclog_or_tty->print_cr(" Total concurrent time = %8.2f s " |
|
2700 "(%8.2f s marking).", |
|
2701 cmThread()->vtime_accum(), |
|
2702 cmThread()->vtime_mark_accum()); |
|
2703 } |
2650 } |
2704 |
2651 |
2705 void ConcurrentMark::print_worker_threads_on(outputStream* st) const { |
2652 void ConcurrentMark::print_worker_threads_on(outputStream* st) const { |
2706 _parallel_workers->print_worker_threads_on(st); |
2653 _parallel_workers->print_worker_threads_on(st); |
2707 } |
2654 } |
3077 // limits to get the regular clock call early |
3024 // limits to get the regular clock call early |
3078 decrease_limits(); |
3025 decrease_limits(); |
3079 } |
3026 } |
3080 |
3027 |
3081 void CMTask::print_stats() { |
3028 void CMTask::print_stats() { |
3082 gclog_or_tty->print_cr("Marking Stats, task = %u, calls = %d", |
3029 log_debug(gc, stats)("Marking Stats, task = %u, calls = %d", |
3083 _worker_id, _calls); |
3030 _worker_id, _calls); |
3084 gclog_or_tty->print_cr(" Elapsed time = %1.2lfms, Termination time = %1.2lfms", |
3031 log_debug(gc, stats)(" Elapsed time = %1.2lfms, Termination time = %1.2lfms", |
3085 _elapsed_time_ms, _termination_time_ms); |
3032 _elapsed_time_ms, _termination_time_ms); |
3086 gclog_or_tty->print_cr(" Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms", |
3033 log_debug(gc, stats)(" Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms", |
3087 _step_times_ms.num(), _step_times_ms.avg(), |
3034 _step_times_ms.num(), _step_times_ms.avg(), |
3088 _step_times_ms.sd()); |
3035 _step_times_ms.sd()); |
3089 gclog_or_tty->print_cr(" max = %1.2lfms, total = %1.2lfms", |
3036 log_debug(gc, stats)(" max = %1.2lfms, total = %1.2lfms", |
3090 _step_times_ms.maximum(), _step_times_ms.sum()); |
3037 _step_times_ms.maximum(), _step_times_ms.sum()); |
3091 } |
3038 } |
3092 |
3039 |
3093 bool ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { |
3040 bool ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { |
3094 return _task_queues->steal(worker_id, hash_seed, obj); |
3041 return _task_queues->steal(worker_id, hash_seed, obj); |
3095 } |
3042 } |
3585 #define G1PPRL_SUM_BYTE_FORMAT(tag) " " tag ": " SIZE_FORMAT |
3532 #define G1PPRL_SUM_BYTE_FORMAT(tag) " " tag ": " SIZE_FORMAT |
3586 #define G1PPRL_SUM_MB_FORMAT(tag) " " tag ": %1.2f MB" |
3533 #define G1PPRL_SUM_MB_FORMAT(tag) " " tag ": %1.2f MB" |
3587 #define G1PPRL_SUM_MB_PERC_FORMAT(tag) G1PPRL_SUM_MB_FORMAT(tag) " / %1.2f %%" |
3534 #define G1PPRL_SUM_MB_PERC_FORMAT(tag) G1PPRL_SUM_MB_FORMAT(tag) " / %1.2f %%" |
3588 |
3535 |
3589 G1PrintRegionLivenessInfoClosure:: |
3536 G1PrintRegionLivenessInfoClosure:: |
3590 G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name) |
3537 G1PrintRegionLivenessInfoClosure(const char* phase_name) |
3591 : _out(out), |
3538 : _total_used_bytes(0), _total_capacity_bytes(0), |
3592 _total_used_bytes(0), _total_capacity_bytes(0), |
|
3593 _total_prev_live_bytes(0), _total_next_live_bytes(0), |
3539 _total_prev_live_bytes(0), _total_next_live_bytes(0), |
3594 _hum_used_bytes(0), _hum_capacity_bytes(0), |
3540 _hum_used_bytes(0), _hum_capacity_bytes(0), |
3595 _hum_prev_live_bytes(0), _hum_next_live_bytes(0), |
3541 _hum_prev_live_bytes(0), _hum_next_live_bytes(0), |
3596 _total_remset_bytes(0), _total_strong_code_roots_bytes(0) { |
3542 _total_remset_bytes(0), _total_strong_code_roots_bytes(0) { |
3597 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
3543 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
3598 MemRegion g1_reserved = g1h->g1_reserved(); |
3544 MemRegion g1_reserved = g1h->g1_reserved(); |
3599 double now = os::elapsedTime(); |
3545 double now = os::elapsedTime(); |
3600 |
3546 |
3601 // Print the header of the output. |
3547 // Print the header of the output. |
3602 _out->cr(); |
3548 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now); |
3603 _out->print_cr(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now); |
3549 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" HEAP" |
3604 _out->print_cr(G1PPRL_LINE_PREFIX" HEAP" |
3550 G1PPRL_SUM_ADDR_FORMAT("reserved") |
3605 G1PPRL_SUM_ADDR_FORMAT("reserved") |
3551 G1PPRL_SUM_BYTE_FORMAT("region-size"), |
3606 G1PPRL_SUM_BYTE_FORMAT("region-size"), |
3552 p2i(g1_reserved.start()), p2i(g1_reserved.end()), |
3607 p2i(g1_reserved.start()), p2i(g1_reserved.end()), |
3553 HeapRegion::GrainBytes); |
3608 HeapRegion::GrainBytes); |
3554 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX); |
3609 _out->print_cr(G1PPRL_LINE_PREFIX); |
3555 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX |
3610 _out->print_cr(G1PPRL_LINE_PREFIX |
3556 G1PPRL_TYPE_H_FORMAT |
3611 G1PPRL_TYPE_H_FORMAT |
3557 G1PPRL_ADDR_BASE_H_FORMAT |
3612 G1PPRL_ADDR_BASE_H_FORMAT |
3558 G1PPRL_BYTE_H_FORMAT |
3613 G1PPRL_BYTE_H_FORMAT |
3559 G1PPRL_BYTE_H_FORMAT |
3614 G1PPRL_BYTE_H_FORMAT |
3560 G1PPRL_BYTE_H_FORMAT |
3615 G1PPRL_BYTE_H_FORMAT |
3561 G1PPRL_DOUBLE_H_FORMAT |
3616 G1PPRL_DOUBLE_H_FORMAT |
3562 G1PPRL_BYTE_H_FORMAT |
3617 G1PPRL_BYTE_H_FORMAT |
3563 G1PPRL_BYTE_H_FORMAT, |
3618 G1PPRL_BYTE_H_FORMAT, |
3564 "type", "address-range", |
3619 "type", "address-range", |
3565 "used", "prev-live", "next-live", "gc-eff", |
3620 "used", "prev-live", "next-live", "gc-eff", |
3566 "remset", "code-roots"); |
3621 "remset", "code-roots"); |
3567 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX |
3622 _out->print_cr(G1PPRL_LINE_PREFIX |
3568 G1PPRL_TYPE_H_FORMAT |
3623 G1PPRL_TYPE_H_FORMAT |
3569 G1PPRL_ADDR_BASE_H_FORMAT |
3624 G1PPRL_ADDR_BASE_H_FORMAT |
3570 G1PPRL_BYTE_H_FORMAT |
3625 G1PPRL_BYTE_H_FORMAT |
3571 G1PPRL_BYTE_H_FORMAT |
3626 G1PPRL_BYTE_H_FORMAT |
3572 G1PPRL_BYTE_H_FORMAT |
3627 G1PPRL_BYTE_H_FORMAT |
3573 G1PPRL_DOUBLE_H_FORMAT |
3628 G1PPRL_DOUBLE_H_FORMAT |
3574 G1PPRL_BYTE_H_FORMAT |
3629 G1PPRL_BYTE_H_FORMAT |
3575 G1PPRL_BYTE_H_FORMAT, |
3630 G1PPRL_BYTE_H_FORMAT, |
3576 "", "", |
3631 "", "", |
3577 "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", |
3632 "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", |
3578 "(bytes)", "(bytes)"); |
3633 "(bytes)", "(bytes)"); |
|
3634 } |
3579 } |
3635 |
3580 |
3636 // It takes as a parameter a reference to one of the _hum_* fields, it |
3581 // It takes as a parameter a reference to one of the _hum_* fields, it |
3637 // deduces the corresponding value for a region in a humongous region |
3582 // deduces the corresponding value for a region in a humongous region |
3638 // series (either the region size, or what's left if the _hum_* field |
3583 // series (either the region size, or what's left if the _hum_* field |
3699 _total_next_live_bytes += next_live_bytes; |
3644 _total_next_live_bytes += next_live_bytes; |
3700 _total_remset_bytes += remset_bytes; |
3645 _total_remset_bytes += remset_bytes; |
3701 _total_strong_code_roots_bytes += strong_code_roots_bytes; |
3646 _total_strong_code_roots_bytes += strong_code_roots_bytes; |
3702 |
3647 |
3703 // Print a line for this particular region. |
3648 // Print a line for this particular region. |
3704 _out->print_cr(G1PPRL_LINE_PREFIX |
3649 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX |
3705 G1PPRL_TYPE_FORMAT |
3650 G1PPRL_TYPE_FORMAT |
3706 G1PPRL_ADDR_BASE_FORMAT |
3651 G1PPRL_ADDR_BASE_FORMAT |
3707 G1PPRL_BYTE_FORMAT |
3652 G1PPRL_BYTE_FORMAT |
3708 G1PPRL_BYTE_FORMAT |
3653 G1PPRL_BYTE_FORMAT |
3709 G1PPRL_BYTE_FORMAT |
3654 G1PPRL_BYTE_FORMAT |
3710 G1PPRL_DOUBLE_FORMAT |
3655 G1PPRL_DOUBLE_FORMAT |
3711 G1PPRL_BYTE_FORMAT |
3656 G1PPRL_BYTE_FORMAT |
3712 G1PPRL_BYTE_FORMAT, |
3657 G1PPRL_BYTE_FORMAT, |
3713 type, p2i(bottom), p2i(end), |
3658 type, p2i(bottom), p2i(end), |
3714 used_bytes, prev_live_bytes, next_live_bytes, gc_eff, |
3659 used_bytes, prev_live_bytes, next_live_bytes, gc_eff, |
3715 remset_bytes, strong_code_roots_bytes); |
3660 remset_bytes, strong_code_roots_bytes); |
3716 |
3661 |
3717 return false; |
3662 return false; |
3718 } |
3663 } |
3719 |
3664 |
3720 G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() { |
3665 G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() { |
3721 // add static memory usages to remembered set sizes |
3666 // add static memory usages to remembered set sizes |
3722 _total_remset_bytes += HeapRegionRemSet::fl_mem_size() + HeapRegionRemSet::static_mem_size(); |
3667 _total_remset_bytes += HeapRegionRemSet::fl_mem_size() + HeapRegionRemSet::static_mem_size(); |
3723 // Print the footer of the output. |
3668 // Print the footer of the output. |
3724 _out->print_cr(G1PPRL_LINE_PREFIX); |
3669 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX); |
3725 _out->print_cr(G1PPRL_LINE_PREFIX |
3670 log_trace(gc, liveness)(G1PPRL_LINE_PREFIX |
3726 " SUMMARY" |
3671 " SUMMARY" |
3727 G1PPRL_SUM_MB_FORMAT("capacity") |
3672 G1PPRL_SUM_MB_FORMAT("capacity") |
3728 G1PPRL_SUM_MB_PERC_FORMAT("used") |
3673 G1PPRL_SUM_MB_PERC_FORMAT("used") |
3729 G1PPRL_SUM_MB_PERC_FORMAT("prev-live") |
3674 G1PPRL_SUM_MB_PERC_FORMAT("prev-live") |
3730 G1PPRL_SUM_MB_PERC_FORMAT("next-live") |
3675 G1PPRL_SUM_MB_PERC_FORMAT("next-live") |
3731 G1PPRL_SUM_MB_FORMAT("remset") |
3676 G1PPRL_SUM_MB_FORMAT("remset") |
3732 G1PPRL_SUM_MB_FORMAT("code-roots"), |
3677 G1PPRL_SUM_MB_FORMAT("code-roots"), |
3733 bytes_to_mb(_total_capacity_bytes), |
3678 bytes_to_mb(_total_capacity_bytes), |
3734 bytes_to_mb(_total_used_bytes), |
3679 bytes_to_mb(_total_used_bytes), |
3735 perc(_total_used_bytes, _total_capacity_bytes), |
3680 perc(_total_used_bytes, _total_capacity_bytes), |
3736 bytes_to_mb(_total_prev_live_bytes), |
3681 bytes_to_mb(_total_prev_live_bytes), |
3737 perc(_total_prev_live_bytes, _total_capacity_bytes), |
3682 perc(_total_prev_live_bytes, _total_capacity_bytes), |
3738 bytes_to_mb(_total_next_live_bytes), |
3683 bytes_to_mb(_total_next_live_bytes), |
3739 perc(_total_next_live_bytes, _total_capacity_bytes), |
3684 perc(_total_next_live_bytes, _total_capacity_bytes), |
3740 bytes_to_mb(_total_remset_bytes), |
3685 bytes_to_mb(_total_remset_bytes), |
3741 bytes_to_mb(_total_strong_code_roots_bytes)); |
3686 bytes_to_mb(_total_strong_code_roots_bytes)); |
3742 _out->cr(); |
3687 } |
3743 } |
|