src/share/vm/memory/genCollectedHeap.cpp

Print this page
rev 4168 : 8005602: NPG: classunloading does not happen while CMS GC with -XX:+CMSClassUnloadingEnabled is used
Summary: Call purge() on CLDG after sweep(), reorder purge() call in GenCollectedHeap and enable some additional logging
Reviewed-by:


 537 
 538     if (complete) { // We did a "major" collection
 539       post_full_gc_dump();   // do any post full gc dumps
 540     }
 541 
 542     if (PrintGCDetails) {
 543       print_heap_change(gch_prev_used);
 544 
 545       // Print metaspace info for full GC with PrintGCDetails flag.
 546       if (complete) {
 547         MetaspaceAux::print_metaspace_change(metadata_prev_used);
 548       }
 549     }
 550 
 551     for (int j = max_level_collected; j >= 0; j -= 1) {
 552       // Adjust generation sizes.
 553       _gens[j]->compute_new_size();
 554     }
 555 
 556     if (complete) {


 557       // Resize the metaspace capacity after full collections
 558       MetaspaceGC::compute_new_size();
 559       update_full_collections_completed();
 560     }
 561 
 562     // Track memory usage and detect low memory after GC finishes
 563     MemoryService::track_memory_usage();
 564 
 565     gc_epilogue(complete);
 566 
 567     // Delete metaspaces for unloaded class loaders and clean up loader_data graph
 568     if (complete) {
 569       ClassLoaderDataGraph::purge();
 570     }
 571 
 572     if (must_restore_marks_for_biased_locking) {
 573       BiasedLocking::restore_marks();
 574     }
 575   }
 576 
 577   AdaptiveSizePolicy* sp = gen_policy()->size_policy();
 578   AdaptiveSizePolicyOutput(sp, total_collections());
 579 
 580   print_heap_after_gc();
 581 
 582 #ifdef TRACESPINNING
 583   ParallelTaskTerminator::print_termination_counts();
 584 #endif
 585 }
 586 
 587 HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab) {
 588   return collector_policy()->satisfy_failed_allocation(size, is_tlab);
 589 }
 590 




 537 
 538     if (complete) { // We did a "major" collection
 539       post_full_gc_dump();   // do any post full gc dumps
 540     }
 541 
 542     if (PrintGCDetails) {
 543       print_heap_change(gch_prev_used);
 544 
 545       // Print metaspace info for full GC with PrintGCDetails flag.
 546       if (complete) {
 547         MetaspaceAux::print_metaspace_change(metadata_prev_used);
 548       }
 549     }
 550 
 551     for (int j = max_level_collected; j >= 0; j -= 1) {
 552       // Adjust generation sizes.
 553       _gens[j]->compute_new_size();
 554     }
 555 
 556     if (complete) {
 557       // Delete metaspaces for unloaded class loaders and clean up loader_data graph
 558       ClassLoaderDataGraph::purge();
 559       // Resize the metaspace capacity after full collections
 560       MetaspaceGC::compute_new_size();
 561       update_full_collections_completed();
 562     }
 563 
 564     // Track memory usage and detect low memory after GC finishes
 565     MemoryService::track_memory_usage();
 566 
 567     gc_epilogue(complete);





 568 
 569     if (must_restore_marks_for_biased_locking) {
 570       BiasedLocking::restore_marks();
 571     }
 572   }
 573 
 574   AdaptiveSizePolicy* sp = gen_policy()->size_policy();
 575   AdaptiveSizePolicyOutput(sp, total_collections());
 576 
 577   print_heap_after_gc();
 578 
 579 #ifdef TRACESPINNING
 580   ParallelTaskTerminator::print_termination_counts();
 581 #endif
 582 }
 583 
 584 HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab) {
 585   return collector_policy()->satisfy_failed_allocation(size, is_tlab);
 586 }
 587