555 if (UseTLAB) { 556 assert(SafepointSynchronize::is_at_safepoint() || 557 !is_init_completed(), 558 "should only accumulate statistics on tlabs at safepoint"); 559 560 ThreadLocalAllocBuffer::accumulate_statistics_before_gc(); 561 } 562 } 563 564 void CollectedHeap::resize_all_tlabs() { 565 if (UseTLAB) { 566 assert(SafepointSynchronize::is_at_safepoint() || 567 !is_init_completed(), 568 "should only resize tlabs at safepoint"); 569 570 ThreadLocalAllocBuffer::resize_all_tlabs(); 571 } 572 } 573 574 void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) { 575 if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) { 576 GCIdMarkAndRestore gc_id_mark; 577 FormatBuffer<> title("Heap Dump (%s full gc)", before ? "before" : "after"); 578 GCTraceTime(Info, gc) tm(title.buffer(), timer); 579 HeapDumper::dump_heap(); 580 } 581 LogHandle(gc, classhisto) log; 582 if (log.is_trace()) { 583 ResourceMark rm; 584 GCIdMarkAndRestore gc_id_mark; 585 FormatBuffer<> title("Class Histogram (%s full gc)", 586 before ? "before" : "after"); 587 GCTraceTime(Trace, gc, classhisto) tm(title.buffer(), timer); 588 VM_GC_HeapInspection inspector(log.trace_stream(), false /* ! full gc */); 589 inspector.doit(); 590 } 591 } 592 593 void CollectedHeap::pre_full_gc_dump(GCTimer* timer) { 594 full_gc_dump(timer, true); 595 } 596 597 void CollectedHeap::post_full_gc_dump(GCTimer* timer) { 598 full_gc_dump(timer, false); 599 } 600 601 void CollectedHeap::initialize_reserved_region(HeapWord *start, HeapWord *end) { 602 // It is important to do this in a way such that concurrent readers can't 603 // temporarily think something is in the heap. (Seen this happen in asserts.) 604 _reserved.set_word_size(0); 605 _reserved.set_start(start); 606 _reserved.set_end(end); 607 } | 555 if (UseTLAB) { 556 assert(SafepointSynchronize::is_at_safepoint() || 557 !is_init_completed(), 558 "should only accumulate statistics on tlabs at safepoint"); 559 560 ThreadLocalAllocBuffer::accumulate_statistics_before_gc(); 561 } 562 } 563 564 void CollectedHeap::resize_all_tlabs() { 565 if (UseTLAB) { 566 assert(SafepointSynchronize::is_at_safepoint() || 567 !is_init_completed(), 568 "should only resize tlabs at safepoint"); 569 570 ThreadLocalAllocBuffer::resize_all_tlabs(); 571 } 572 } 573 574 void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) { 575 assert(timer != NULL, "timer is null"); 576 if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) { 577 GCTraceTime(Info, gc) tm(before ? "Heap Dump (before full gc)" : "Heap Dump (after full gc)", timer); 578 HeapDumper::dump_heap(); 579 } 580 581 LogHandle(gc, classhisto) log; 582 if (log.is_trace()) { 583 GCTraceTime(Trace, gc, classhisto) tm(before ? "Class Histogram (before full gc)" : "Class Histogram (after full gc)", timer); 584 ResourceMark rm; 585 VM_GC_HeapInspection inspector(log.trace_stream(), false /* ! full gc */); 586 inspector.doit(); 587 } 588 } 589 590 void CollectedHeap::pre_full_gc_dump(GCTimer* timer) { 591 full_gc_dump(timer, true); 592 } 593 594 void CollectedHeap::post_full_gc_dump(GCTimer* timer) { 595 full_gc_dump(timer, false); 596 } 597 598 void CollectedHeap::initialize_reserved_region(HeapWord *start, HeapWord *end) { 599 // It is important to do this in a way such that concurrent readers can't 600 // temporarily think something is in the heap. (Seen this happen in asserts.) 601 _reserved.set_word_size(0); 602 _reserved.set_start(start); 603 _reserved.set_end(end); 604 } |