< prev index next >

src/hotspot/share/gc/serial/defNewGeneration.cpp

Print this page




  24 
  25 #include "precompiled.hpp"
  26 #include "gc/serial/defNewGeneration.inline.hpp"
  27 #include "gc/shared/ageTable.inline.hpp"
  28 #include "gc/shared/cardTableRS.hpp"
  29 #include "gc/shared/collectorCounters.hpp"
  30 #include "gc/shared/gcHeapSummary.hpp"
  31 #include "gc/shared/gcLocker.inline.hpp"
  32 #include "gc/shared/gcPolicyCounters.hpp"
  33 #include "gc/shared/gcTimer.hpp"
  34 #include "gc/shared/gcTrace.hpp"
  35 #include "gc/shared/gcTraceTime.inline.hpp"
  36 #include "gc/shared/genCollectedHeap.hpp"
  37 #include "gc/shared/genOopClosures.inline.hpp"
  38 #include "gc/shared/generationSpec.hpp"
  39 #include "gc/shared/preservedMarks.inline.hpp"
  40 #include "gc/shared/referencePolicy.hpp"
  41 #include "gc/shared/space.inline.hpp"
  42 #include "gc/shared/spaceDecorator.hpp"
  43 #include "gc/shared/strongRootsScope.hpp"

  44 #include "logging/log.hpp"
  45 #include "memory/iterator.hpp"
  46 #include "memory/resourceArea.hpp"
  47 #include "oops/instanceRefKlass.hpp"
  48 #include "oops/oop.inline.hpp"
  49 #include "runtime/atomic.hpp"
  50 #include "runtime/java.hpp"
  51 #include "runtime/prefetch.inline.hpp"
  52 #include "runtime/thread.inline.hpp"
  53 #include "utilities/align.hpp"
  54 #include "utilities/copy.hpp"
  55 #include "utilities/globalDefinitions.hpp"
  56 #include "utilities/stack.inline.hpp"
  57 #if INCLUDE_ALL_GCS
  58 #include "gc/cms/parOopClosures.hpp"
  59 #endif
  60 
  61 //
  62 // DefNewGeneration functions.
  63 


 640 
 641     gch->young_process_roots(&srs,
 642                              &fsc_with_no_gc_barrier,
 643                              &fsc_with_gc_barrier,
 644                              &cld_scan_closure);
 645   }
 646 
 647   // "evacuate followers".
 648   evacuate_followers.do_void();
 649 
 650   FastKeepAliveClosure keep_alive(this, &scan_weak_ref);
 651   ReferenceProcessor* rp = ref_processor();
 652   rp->setup_policy(clear_all_soft_refs);
 653   ReferenceProcessorPhaseTimes pt(_gc_timer, rp->num_q());
 654   const ReferenceProcessorStats& stats =
 655   rp->process_discovered_references(&is_alive, &keep_alive, &evacuate_followers,
 656                                     NULL, &pt);
 657   gc_tracer.report_gc_reference_stats(stats);
 658   gc_tracer.report_tenuring_threshold(tenuring_threshold());
 659   pt.print_all_references();


 660 
 661   if (!_promotion_failed) {
 662     // Swap the survivor spaces.
 663     eden()->clear(SpaceDecorator::Mangle);
 664     from()->clear(SpaceDecorator::Mangle);
 665     if (ZapUnusedHeapArea) {
 666       // This is now done here because of the piece-meal mangling which
 667       // can check for valid mangling at intermediate points in the
 668       // collection(s).  When a young collection fails to collect
 669       // sufficient space resizing of the young generation can occur
 670       // an redistribute the spaces in the young generation.  Mangle
 671       // here so that unzapped regions don't get distributed to
 672       // other spaces.
 673       to()->mangle_unused_area();
 674     }
 675     swap_spaces();
 676 
 677     assert(to()->is_empty(), "to space should be empty now");
 678 
 679     adjust_desired_tenuring_threshold();




  24 
  25 #include "precompiled.hpp"
  26 #include "gc/serial/defNewGeneration.inline.hpp"
  27 #include "gc/shared/ageTable.inline.hpp"
  28 #include "gc/shared/cardTableRS.hpp"
  29 #include "gc/shared/collectorCounters.hpp"
  30 #include "gc/shared/gcHeapSummary.hpp"
  31 #include "gc/shared/gcLocker.inline.hpp"
  32 #include "gc/shared/gcPolicyCounters.hpp"
  33 #include "gc/shared/gcTimer.hpp"
  34 #include "gc/shared/gcTrace.hpp"
  35 #include "gc/shared/gcTraceTime.inline.hpp"
  36 #include "gc/shared/genCollectedHeap.hpp"
  37 #include "gc/shared/genOopClosures.inline.hpp"
  38 #include "gc/shared/generationSpec.hpp"
  39 #include "gc/shared/preservedMarks.inline.hpp"
  40 #include "gc/shared/referencePolicy.hpp"
  41 #include "gc/shared/space.inline.hpp"
  42 #include "gc/shared/spaceDecorator.hpp"
  43 #include "gc/shared/strongRootsScope.hpp"
  44 #include "gc/shared/weakProcessor.hpp"
  45 #include "logging/log.hpp"
  46 #include "memory/iterator.hpp"
  47 #include "memory/resourceArea.hpp"
  48 #include "oops/instanceRefKlass.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "runtime/atomic.hpp"
  51 #include "runtime/java.hpp"
  52 #include "runtime/prefetch.inline.hpp"
  53 #include "runtime/thread.inline.hpp"
  54 #include "utilities/align.hpp"
  55 #include "utilities/copy.hpp"
  56 #include "utilities/globalDefinitions.hpp"
  57 #include "utilities/stack.inline.hpp"
  58 #if INCLUDE_ALL_GCS
  59 #include "gc/cms/parOopClosures.hpp"
  60 #endif
  61 
  62 //
  63 // DefNewGeneration functions.
  64 


 641 
 642     gch->young_process_roots(&srs,
 643                              &fsc_with_no_gc_barrier,
 644                              &fsc_with_gc_barrier,
 645                              &cld_scan_closure);
 646   }
 647 
 648   // "evacuate followers".
 649   evacuate_followers.do_void();
 650 
 651   FastKeepAliveClosure keep_alive(this, &scan_weak_ref);
 652   ReferenceProcessor* rp = ref_processor();
 653   rp->setup_policy(clear_all_soft_refs);
 654   ReferenceProcessorPhaseTimes pt(_gc_timer, rp->num_q());
 655   const ReferenceProcessorStats& stats =
 656   rp->process_discovered_references(&is_alive, &keep_alive, &evacuate_followers,
 657                                     NULL, &pt);
 658   gc_tracer.report_gc_reference_stats(stats);
 659   gc_tracer.report_tenuring_threshold(tenuring_threshold());
 660   pt.print_all_references();
 661 
 662   WeakProcessor::weak_oops_do(&is_alive, &keep_alive);
 663 
 664   if (!_promotion_failed) {
 665     // Swap the survivor spaces.
 666     eden()->clear(SpaceDecorator::Mangle);
 667     from()->clear(SpaceDecorator::Mangle);
 668     if (ZapUnusedHeapArea) {
 669       // This is now done here because of the piece-meal mangling which
 670       // can check for valid mangling at intermediate points in the
 671       // collection(s).  When a young collection fails to collect
 672       // sufficient space resizing of the young generation can occur
 673       // an redistribute the spaces in the young generation.  Mangle
 674       // here so that unzapped regions don't get distributed to
 675       // other spaces.
 676       to()->mangle_unused_area();
 677     }
 678     swap_spaces();
 679 
 680     assert(to()->is_empty(), "to space should be empty now");
 681 
 682     adjust_desired_tenuring_threshold();


< prev index next >