src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

Print this page
rev 6085 : 8036703: Add trace event with statistics for the metaspace chunk free lists


2479   _gc_tracer_cm->report_gc_start(cause, _gc_timer_cm->gc_start());
2480 }
2481 
2482 void CMSCollector::register_gc_end() {
2483   if (_cms_start_registered) {
2484     report_heap_summary(GCWhen::AfterGC);
2485 
2486     _gc_timer_cm->register_gc_end();
2487     _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
2488     _cms_start_registered = false;
2489   }
2490 }
2491 
2492 void CMSCollector::save_heap_summary() {
2493   GenCollectedHeap* gch = GenCollectedHeap::heap();
2494   _last_heap_summary = gch->create_heap_summary();
2495   _last_metaspace_summary = gch->create_metaspace_summary();
2496 }
2497 
2498 void CMSCollector::report_heap_summary(GCWhen::Type when) {
2499   _gc_tracer_cm->report_gc_heap_summary(when, _last_heap_summary, _last_metaspace_summary);

2500 }
2501 
2502 void CMSCollector::collect_in_foreground(bool clear_all_soft_refs, GCCause::Cause cause) {
2503   assert(_foregroundGCIsActive && !_foregroundGCShouldWait,
2504          "Foreground collector should be waiting, not executing");
2505   assert(Thread::current()->is_VM_thread(), "A foreground collection"
2506     "may only be done by the VM Thread with the world stopped");
2507   assert(ConcurrentMarkSweepThread::vm_thread_has_cms_token(),
2508          "VM thread should have CMS token");
2509 
2510   NOT_PRODUCT(GCTraceTime t("CMS:MS (foreground) ", PrintGCDetails && Verbose,
2511     true, NULL);)
2512   if (UseAdaptiveSizePolicy) {
2513     size_policy()->ms_collection_begin();
2514   }
2515   COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
2516 
2517   HandleMark hm;  // Discard invalid handles created during verification
2518 
2519   if (VerifyBeforeGC &&




2479   _gc_tracer_cm->report_gc_start(cause, _gc_timer_cm->gc_start());
2480 }
2481 
2482 void CMSCollector::register_gc_end() {
2483   if (_cms_start_registered) {
2484     report_heap_summary(GCWhen::AfterGC);
2485 
2486     _gc_timer_cm->register_gc_end();
2487     _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
2488     _cms_start_registered = false;
2489   }
2490 }
2491 
2492 void CMSCollector::save_heap_summary() {
2493   GenCollectedHeap* gch = GenCollectedHeap::heap();
2494   _last_heap_summary = gch->create_heap_summary();
2495   _last_metaspace_summary = gch->create_metaspace_summary();
2496 }
2497 
2498 void CMSCollector::report_heap_summary(GCWhen::Type when) {
2499   _gc_tracer_cm->report_gc_heap_summary(when, _last_heap_summary);
2500   _gc_tracer_cm->report_metaspace_summary(when, _last_metaspace_summary);
2501 }
2502 
2503 void CMSCollector::collect_in_foreground(bool clear_all_soft_refs, GCCause::Cause cause) {
2504   assert(_foregroundGCIsActive && !_foregroundGCShouldWait,
2505          "Foreground collector should be waiting, not executing");
2506   assert(Thread::current()->is_VM_thread(), "A foreground collection"
2507     "may only be done by the VM Thread with the world stopped");
2508   assert(ConcurrentMarkSweepThread::vm_thread_has_cms_token(),
2509          "VM thread should have CMS token");
2510 
2511   NOT_PRODUCT(GCTraceTime t("CMS:MS (foreground) ", PrintGCDetails && Verbose,
2512     true, NULL);)
2513   if (UseAdaptiveSizePolicy) {
2514     size_policy()->ms_collection_begin();
2515   }
2516   COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
2517 
2518   HandleMark hm;  // Discard invalid handles created during verification
2519 
2520   if (VerifyBeforeGC &&