78 79 void 80 G1ParScanThreadState::print_termination_stats_hdr(outputStream* const st) 81 { 82 st->print_raw_cr("GC Termination Stats"); 83 st->print_raw_cr(" elapsed --strong roots-- -------termination-------" 84 " ------waste (KiB)------"); 85 st->print_raw_cr("thr ms ms % ms % attempts" 86 " total alloc undo"); 87 st->print_raw_cr("--- --------- --------- ------ --------- ------ --------" 88 " ------- ------- -------"); 89 } 90 91 void 92 G1ParScanThreadState::print_termination_stats(int i, 93 outputStream* const st) const 94 { 95 const double elapsed_ms = elapsed_time() * 1000.0; 96 const double s_roots_ms = strong_roots_time() * 1000.0; 97 const double term_ms = term_time() * 1000.0; 98 const size_t alloc_buffer_waste = _g1_par_allocator->alloc_buffer_waste(); 99 const size_t undo_waste = _g1_par_allocator->undo_waste(); 100 st->print_cr("%3d %9.2f %9.2f %6.2f " 101 "%9.2f %6.2f " SIZE_FORMAT_W(8) " " 102 SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7), 103 i, elapsed_ms, s_roots_ms, s_roots_ms * 100 / elapsed_ms, 104 term_ms, term_ms * 100 / elapsed_ms, term_attempts(), 105 (alloc_buffer_waste + undo_waste) * HeapWordSize / K, 106 alloc_buffer_waste * HeapWordSize / K, 107 undo_waste * HeapWordSize / K); 108 } 109 110 #ifdef ASSERT 111 bool G1ParScanThreadState::verify_ref(narrowOop* ref) const { 112 assert(ref != NULL, "invariant"); 113 assert(UseCompressedOops, "sanity"); 114 assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, p2i(ref))); 115 oop p = oopDesc::load_decode_heap_oop(ref); 116 assert(_g1h->is_in_g1_reserved(p), 117 err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p))); 118 return true; 119 } | 78 79 void 80 G1ParScanThreadState::print_termination_stats_hdr(outputStream* const st) 81 { 82 st->print_raw_cr("GC Termination Stats"); 83 st->print_raw_cr(" elapsed --strong roots-- -------termination-------" 84 " ------waste (KiB)------"); 85 st->print_raw_cr("thr ms ms % ms % attempts" 86 " total alloc undo"); 87 st->print_raw_cr("--- --------- --------- ------ --------- ------ --------" 88 " ------- ------- -------"); 89 } 90 91 void 92 G1ParScanThreadState::print_termination_stats(int i, 93 outputStream* const st) const 94 { 95 const double elapsed_ms = elapsed_time() * 1000.0; 96 const double s_roots_ms = strong_roots_time() * 1000.0; 97 const double term_ms = term_time() * 1000.0; 98 size_t alloc_buffer_waste = 0; 99 size_t undo_waste = 0; 100 _g1_par_allocator->waste(alloc_buffer_waste, undo_waste); 101 st->print_cr("%3d %9.2f %9.2f %6.2f " 102 "%9.2f %6.2f " SIZE_FORMAT_W(8) " " 103 SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7), 104 i, elapsed_ms, s_roots_ms, s_roots_ms * 100 / elapsed_ms, 105 term_ms, term_ms * 100 / elapsed_ms, term_attempts(), 106 (alloc_buffer_waste + undo_waste) * HeapWordSize / K, 107 alloc_buffer_waste * HeapWordSize / K, 108 undo_waste * HeapWordSize / K); 109 } 110 111 #ifdef ASSERT 112 bool G1ParScanThreadState::verify_ref(narrowOop* ref) const { 113 assert(ref != NULL, "invariant"); 114 assert(UseCompressedOops, "sanity"); 115 assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, p2i(ref))); 116 oop p = oopDesc::load_decode_heap_oop(ref); 117 assert(_g1h->is_in_g1_reserved(p), 118 err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p))); 119 return true; 120 } |