< prev index next >

src/share/vm/gc/g1/g1ConcurrentMark.cpp

Print this page




1719     rp->set_active_mt_degree(active_workers);
1720 
1721     // Process the weak references.
1722     const ReferenceProcessorStats& stats =
1723         rp->process_discovered_references(&g1_is_alive,
1724                                           &g1_keep_alive,
1725                                           &g1_drain_mark_stack,
1726                                           executor,
1727                                           _gc_timer_cm);
1728     _gc_tracer_cm->report_gc_reference_stats(stats);
1729 
1730     // The do_oop work routines of the keep_alive and drain_marking_stack
1731     // oop closures will set the has_overflown flag if we overflow the
1732     // global marking stack.
1733 
1734     assert(has_overflown() || _global_mark_stack.is_empty(),
1735             "Mark stack should be empty (unless it has overflown)");
1736 
1737     assert(rp->num_q() == active_workers, "why not");
1738 
1739     rp->enqueue_discovered_references(executor);
1740 
1741     rp->verify_no_references_recorded();
1742     assert(!rp->discovery_enabled(), "Post condition");
1743   }
1744 
1745   if (has_overflown()) {
1746     // We can not trust g1_is_alive if the marking stack overflowed
1747     return;
1748   }
1749 
1750   assert(_global_mark_stack.is_empty(), "Marking should have completed");
1751 
1752   // Unload Klasses, String, Symbols, Code Cache, etc.
1753   if (ClassUnloadingWithConcurrentMark) {
1754     GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
1755     bool purged_classes = SystemDictionary::do_unloading(&g1_is_alive, _gc_timer_cm, false /* Defer cleaning */);
1756     g1h->complete_cleaning(&g1_is_alive, purged_classes);
1757   } else {
1758     GCTraceTime(Debug, gc, phases) debug("Cleanup", _gc_timer_cm);
1759     // No need to clean string table and symbol table as they are treated as strong roots when




1719     rp->set_active_mt_degree(active_workers);
1720 
1721     // Process the weak references.
1722     const ReferenceProcessorStats& stats =
1723         rp->process_discovered_references(&g1_is_alive,
1724                                           &g1_keep_alive,
1725                                           &g1_drain_mark_stack,
1726                                           executor,
1727                                           _gc_timer_cm);
1728     _gc_tracer_cm->report_gc_reference_stats(stats);
1729 
1730     // The do_oop work routines of the keep_alive and drain_marking_stack
1731     // oop closures will set the has_overflown flag if we overflow the
1732     // global marking stack.
1733 
1734     assert(has_overflown() || _global_mark_stack.is_empty(),
1735             "Mark stack should be empty (unless it has overflown)");
1736 
1737     assert(rp->num_q() == active_workers, "why not");
1738 
1739     rp->enqueue_discovered_references(executor, _gc_timer_cm);
1740 
1741     rp->verify_no_references_recorded();
1742     assert(!rp->discovery_enabled(), "Post condition");
1743   }
1744 
1745   if (has_overflown()) {
1746     // We can not trust g1_is_alive if the marking stack overflowed
1747     return;
1748   }
1749 
1750   assert(_global_mark_stack.is_empty(), "Marking should have completed");
1751 
1752   // Unload Klasses, String, Symbols, Code Cache, etc.
1753   if (ClassUnloadingWithConcurrentMark) {
1754     GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
1755     bool purged_classes = SystemDictionary::do_unloading(&g1_is_alive, _gc_timer_cm, false /* Defer cleaning */);
1756     g1h->complete_cleaning(&g1_is_alive, purged_classes);
1757   } else {
1758     GCTraceTime(Debug, gc, phases) debug("Cleanup", _gc_timer_cm);
1759     // No need to clean string table and symbol table as they are treated as strong roots when


< prev index next >