Print this page
rev 6875 : 8056240: Investigate increased GC remark time after class unloading changes in CRM Fuse
Reviewed-by: mgerdin, coleenp, bdelsart

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp
          +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * 2 along with this work; if not, write to the Free Software Foundation,
  17   17   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18   18   *
  19   19   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20   20   * or visit www.oracle.com if you need additional information or have any
  21   21   * questions.
  22   22   *
  23   23   */
  24   24  
  25   25  #include "precompiled.hpp"
       26 +#include "classfile/metadataOnStackMark.hpp"
  26   27  #include "classfile/symbolTable.hpp"
  27   28  #include "code/codeCache.hpp"
  28   29  #include "gc_implementation/g1/concurrentMark.inline.hpp"
  29   30  #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
  30   31  #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  31   32  #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  32   33  #include "gc_implementation/g1/g1ErgoVerbose.hpp"
  33   34  #include "gc_implementation/g1/g1Log.hpp"
  34   35  #include "gc_implementation/g1/g1OopClosures.inline.hpp"
  35   36  #include "gc_implementation/g1/g1RemSet.hpp"
↓ open down ↓ 2559 lines elided ↑ open up ↑
2595 2596      return;
2596 2597    }
2597 2598  
2598 2599    assert(_markStack.isEmpty(), "Marking should have completed");
2599 2600  
2600 2601    // Unload Klasses, String, Symbols, Code Cache, etc.
2601 2602    {
2602 2603      G1RemarkGCTraceTime trace("Unloading", G1Log::finer());
2603 2604  
2604 2605      if (ClassUnloadingWithConcurrentMark) {
     2606 +      // Cleaning of klasses depends on correct information from MetadataMarkOnStack. The CodeCache::mark_on_stack
     2607 +      // part is too slow to be done serially, so it is handled during the weakRefsWorkParallelPart phase.
     2608 +      // Defer the cleaning until we have complete on_stack data.
     2609 +      MetadataOnStackMark md_on_stack(false /* Don't visit the code cache at this point */);
     2610 +
2605 2611        bool purged_classes;
2606 2612  
2607 2613        {
2608 2614          G1RemarkGCTraceTime trace("System Dictionary Unloading", G1Log::finest());
2609      -        purged_classes = SystemDictionary::do_unloading(&g1_is_alive);
     2615 +        purged_classes = SystemDictionary::do_unloading(&g1_is_alive, false /* Defer klass cleaning */);
2610 2616        }
2611 2617  
2612 2618        {
2613 2619          G1RemarkGCTraceTime trace("Parallel Unloading", G1Log::finest());
2614 2620          weakRefsWorkParallelPart(&g1_is_alive, purged_classes);
2615 2621        }
     2622 +
     2623 +      {
     2624 +        G1RemarkGCTraceTime trace("Deallocate Metadata", G1Log::finest());
     2625 +        ClassLoaderDataGraph::free_deallocate_lists();
     2626 +      }
2616 2627      }
2617 2628  
2618 2629      if (G1StringDedup::is_enabled()) {
2619 2630        G1RemarkGCTraceTime trace("String Deduplication Unlink", G1Log::finest());
2620 2631        G1StringDedup::unlink(&g1_is_alive);
2621 2632      }
2622 2633    }
2623 2634  }
2624 2635  
2625 2636  void ConcurrentMark::swapMarkBitMaps() {
↓ open down ↓ 2193 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX