56 PADDING_ELEM_NUM;
57 _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
58 if (_surviving_young_words_base == NULL)
59 vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR,
60 "Not enough space for young surv histo.");
61 _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
62 memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t));
63
64 _plab_allocator = G1PLABAllocator::create_allocator(_g1h->allocator());
65
66 _dest[InCSetState::NotInCSet] = InCSetState::NotInCSet;
67 // The dest for Young is used when the objects are aged enough to
68 // need to be moved to the next space.
69 _dest[InCSetState::Young] = InCSetState::Old;
70 _dest[InCSetState::Old] = InCSetState::Old;
71
72 _start = os::elapsedTime();
73 }
74
75 G1ParScanThreadState::~G1ParScanThreadState() {
76 _plab_allocator->retire_alloc_buffers();
77 delete _plab_allocator;
78 FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base);
79 }
80
81 void G1ParScanThreadState::print_termination_stats_hdr(outputStream* const st) {
82 st->print_raw_cr("GC Termination Stats");
83 st->print_raw_cr(" elapsed --strong roots-- -------termination------- ------waste (KiB)------");
84 st->print_raw_cr("thr ms ms % ms % attempts total alloc undo");
85 st->print_raw_cr("--- --------- --------- ------ --------- ------ -------- ------- ------- -------");
86 }
87
88 void G1ParScanThreadState::print_termination_stats(outputStream* const st) const {
89 const double elapsed_ms = elapsed_time() * 1000.0;
90 const double s_roots_ms = strong_roots_time() * 1000.0;
91 const double term_ms = term_time() * 1000.0;
92 size_t alloc_buffer_waste = 0;
93 size_t undo_waste = 0;
94 _plab_allocator->waste(alloc_buffer_waste, undo_waste);
95 st->print_cr("%3u %9.2f %9.2f %6.2f "
96 "%9.2f %6.2f " SIZE_FORMAT_W(8) " "
|
56 PADDING_ELEM_NUM;
57 _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
58 if (_surviving_young_words_base == NULL)
59 vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR,
60 "Not enough space for young surv histo.");
61 _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
62 memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t));
63
64 _plab_allocator = G1PLABAllocator::create_allocator(_g1h->allocator());
65
66 _dest[InCSetState::NotInCSet] = InCSetState::NotInCSet;
67 // The dest for Young is used when the objects are aged enough to
68 // need to be moved to the next space.
69 _dest[InCSetState::Young] = InCSetState::Old;
70 _dest[InCSetState::Old] = InCSetState::Old;
71
72 _start = os::elapsedTime();
73 }
74
75 G1ParScanThreadState::~G1ParScanThreadState() {
76 _plab_allocator->flush_and_retire_stats();
77 delete _plab_allocator;
78 FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base);
79 }
80
81 void G1ParScanThreadState::print_termination_stats_hdr(outputStream* const st) {
82 st->print_raw_cr("GC Termination Stats");
83 st->print_raw_cr(" elapsed --strong roots-- -------termination------- ------waste (KiB)------");
84 st->print_raw_cr("thr ms ms % ms % attempts total alloc undo");
85 st->print_raw_cr("--- --------- --------- ------ --------- ------ -------- ------- ------- -------");
86 }
87
88 void G1ParScanThreadState::print_termination_stats(outputStream* const st) const {
89 const double elapsed_ms = elapsed_time() * 1000.0;
90 const double s_roots_ms = strong_roots_time() * 1000.0;
91 const double term_ms = term_time() * 1000.0;
92 size_t alloc_buffer_waste = 0;
93 size_t undo_waste = 0;
94 _plab_allocator->waste(alloc_buffer_waste, undo_waste);
95 st->print_cr("%3u %9.2f %9.2f %6.2f "
96 "%9.2f %6.2f " SIZE_FORMAT_W(8) " "
|