< prev index next >

src/hotspot/share/gc/shared/collectedHeap.cpp

Print this page




 485     // Accumulate statistics before retiring
 486     ThreadLocalAllocBuffer::accumulate_statistics_before_gc();
 487   }
 488 
 489   // The main thread starts allocating via a TLAB even before it
 490   // has added itself to the threads list at vm boot-up.
 491   JavaThreadIteratorWithHandle jtiwh;
 492   assert(jtiwh.length() > 0,
 493          "Attempt to fill tlabs before main thread has been added"
 494          " to threads list is doomed to failure!");
 495   BarrierSet *bs = BarrierSet::barrier_set();
 496   for (; JavaThread *thread = jtiwh.next(); ) {
 497      if (UseTLAB) {
 498        thread->tlab().make_parsable(retire_tlabs);
 499      }
 500      bs->make_parsable(thread);
 501   }
 502 }
 503 
 504 void CollectedHeap::resize_all_tlabs() {
 505   if (UseTLAB) {
 506     assert(SafepointSynchronize::is_at_safepoint() ||
 507          !is_init_completed(),
 508          "should only resize tlabs at safepoint");
 509 
 510     ThreadLocalAllocBuffer::resize_all_tlabs();



 511   }
 512 }
 513 
 514 void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) {
 515   assert(timer != NULL, "timer is null");
 516   if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) {
 517     GCTraceTime(Info, gc) tm(before ? "Heap Dump (before full gc)" : "Heap Dump (after full gc)", timer);
 518     HeapDumper::dump_heap();
 519   }
 520 
 521   LogTarget(Trace, gc, classhisto) lt;
 522   if (lt.is_enabled()) {
 523     GCTraceTime(Trace, gc, classhisto) tm(before ? "Class Histogram (before full gc)" : "Class Histogram (after full gc)", timer);
 524     ResourceMark rm;
 525     LogStream ls(lt);
 526     VM_GC_HeapInspection inspector(&ls, false /* ! full gc */);
 527     inspector.doit();
 528   }
 529 }
 530 




 485     // Accumulate statistics before retiring
 486     ThreadLocalAllocBuffer::accumulate_statistics_before_gc();
 487   }
 488 
 489   // The main thread starts allocating via a TLAB even before it
 490   // has added itself to the threads list at vm boot-up.
 491   JavaThreadIteratorWithHandle jtiwh;
 492   assert(jtiwh.length() > 0,
 493          "Attempt to fill tlabs before main thread has been added"
 494          " to threads list is doomed to failure!");
 495   BarrierSet *bs = BarrierSet::barrier_set();
 496   for (; JavaThread *thread = jtiwh.next(); ) {
 497      if (UseTLAB) {
 498        thread->tlab().make_parsable(retire_tlabs);
 499      }
 500      bs->make_parsable(thread);
 501   }
 502 }
 503 
 504 void CollectedHeap::resize_all_tlabs() {
 505   assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(),
 506          "Should only resize tlabs at safepoint");


 507 
 508   if (UseTLAB && ResizeTLAB) {
 509     for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
 510       thread->tlab().resize();
 511     }
 512   }
 513 }
 514 
 515 void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) {
 516   assert(timer != NULL, "timer is null");
 517   if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) {
 518     GCTraceTime(Info, gc) tm(before ? "Heap Dump (before full gc)" : "Heap Dump (after full gc)", timer);
 519     HeapDumper::dump_heap();
 520   }
 521 
 522   LogTarget(Trace, gc, classhisto) lt;
 523   if (lt.is_enabled()) {
 524     GCTraceTime(Trace, gc, classhisto) tm(before ? "Class Histogram (before full gc)" : "Class Histogram (after full gc)", timer);
 525     ResourceMark rm;
 526     LogStream ls(lt);
 527     VM_GC_HeapInspection inspector(&ls, false /* ! full gc */);
 528     inspector.doit();
 529   }
 530 }
 531 


< prev index next >