< prev index next >

src/share/vm/gc/serial/genMarkSweep.cpp

Print this page

        

@@ -218,21 +218,25 @@
   }
 
   // This is the point where the entire marking should have completed.
   assert(_marking_stack.is_empty(), "Marking should have completed");
 
-  {
+  if (ClassUnloading) {
     GCTraceTime(Debug, gc, phases) tm_m("Class Unloading", gc_timer());
 
     // Unload classes and purge the SystemDictionary.
     bool purged_class = SystemDictionary::do_unloading(&is_alive);
 
     // Unload nmethods.
     CodeCache::do_unloading(&is_alive, purged_class);
 
     // Prune dead klasses from subklass/sibling/implementor lists.
     Klass::clean_weak_klass_links(&is_alive);
+  } else {
+    // Unload nmethods.
+    GCTraceTime(Debug, gc, phases) tm_m("NMethod Unloading", gc_timer());
+    CodeCache::do_unloading(&is_alive, false);
   }
 
   {
     GCTraceTime(Debug, gc, phases) t("Scrub String Table", gc_timer());
     // Delete entries for dead interned strings.
< prev index next >