476 }
477
478 stats.publish();
479 }
480
481 void CollectedHeap::resize_all_tlabs() {
482 assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(),
483 "Should only resize tlabs at safepoint");
484
485 if (UseTLAB && ResizeTLAB) {
486 for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
487 thread->tlab().resize();
488 }
489 }
490 }
491
492 jlong CollectedHeap::millis_since_last_whole_heap_examined() {
493 return (os::javaTimeNanos() - _last_whole_heap_examined_time_ns) / NANOSECS_PER_MILLISEC;
494 }
495
496 void CollectedHeap::next_whole_heap_examined() {
497 _last_whole_heap_examined_time_ns = os::javaTimeNanos();
498 }
499
500 void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) {
501 assert(timer != NULL, "timer is null");
502 if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) {
503 GCTraceTime(Info, gc) tm(before ? "Heap Dump (before full gc)" : "Heap Dump (after full gc)", timer);
504 HeapDumper::dump_heap();
505 }
506
507 LogTarget(Trace, gc, classhisto) lt;
508 if (lt.is_enabled()) {
509 GCTraceTime(Trace, gc, classhisto) tm(before ? "Class Histogram (before full gc)" : "Class Histogram (after full gc)", timer);
510 ResourceMark rm;
511 LogStream ls(lt);
512 VM_GC_HeapInspection inspector(&ls, false /* ! full gc */);
513 inspector.doit();
514 }
515 }
516
|
476 }
477
478 stats.publish();
479 }
480
481 void CollectedHeap::resize_all_tlabs() {
482 assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(),
483 "Should only resize tlabs at safepoint");
484
485 if (UseTLAB && ResizeTLAB) {
486 for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
487 thread->tlab().resize();
488 }
489 }
490 }
491
492 jlong CollectedHeap::millis_since_last_whole_heap_examined() {
493 return (os::javaTimeNanos() - _last_whole_heap_examined_time_ns) / NANOSECS_PER_MILLISEC;
494 }
495
496 void CollectedHeap::record_whole_heap_examined_timestamp() {
497 _last_whole_heap_examined_time_ns = os::javaTimeNanos();
498 }
499
500 void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) {
501 assert(timer != NULL, "timer is null");
502 if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) {
503 GCTraceTime(Info, gc) tm(before ? "Heap Dump (before full gc)" : "Heap Dump (after full gc)", timer);
504 HeapDumper::dump_heap();
505 }
506
507 LogTarget(Trace, gc, classhisto) lt;
508 if (lt.is_enabled()) {
509 GCTraceTime(Trace, gc, classhisto) tm(before ? "Class Histogram (before full gc)" : "Class Histogram (after full gc)", timer);
510 ResourceMark rm;
511 LogStream ls(lt);
512 VM_GC_HeapInspection inspector(&ls, false /* ! full gc */);
513 inspector.doit();
514 }
515 }
516
|