src/share/vm/memory/genMarkSweep.cpp

Print this page
rev 4274 : 8008920: Tracing events for heap statistics


  93   // implicitly collected whenever we do a full mark sweep collection.
  94   gch->perm_gen()->stat_record()->invocations++;
  95 
  96   // Capture heap size before collection for printing.
  97   size_t gch_prev_used = gch->used();
  98 
  99   // Some of the card table updates below assume that the perm gen is
 100   // also being collected.
 101   assert(level == gch->n_gens() - 1,
 102          "All generations are being collected, ergo perm gen too.");
 103 
 104   // Capture used regions for each generation that will be
 105   // subject to collection, so that card table adjustments can
 106   // be made intelligently (see clear / invalidate further below).
 107   gch->save_used_regions(level, true /* perm */);
 108 
 109   allocate_stacks();
 110 
 111   mark_sweep_phase1(level, clear_all_softrefs);
 112 


 113   mark_sweep_phase2();
 114 
 115   // Don't add any more derived pointers during phase3
 116   COMPILER2_PRESENT(assert(DerivedPointerTable::is_active(), "Sanity"));
 117   COMPILER2_PRESENT(DerivedPointerTable::set_active(false));
 118 
 119   mark_sweep_phase3(level);
 120 
 121   VALIDATE_MARK_SWEEP_ONLY(
 122     if (ValidateMarkSweep) {
 123       guarantee(_root_refs_stack->length() == 0, "should be empty by now");
 124     }
 125   )
 126 
 127   mark_sweep_phase4();
 128 
 129   VALIDATE_MARK_SWEEP_ONLY(
 130     if (ValidateMarkSweep) {
 131       guarantee(_live_oops->length() == _live_oops_moved_to->length(),
 132                 "should be the same size");




  93   // implicitly collected whenever we do a full mark sweep collection.
  94   gch->perm_gen()->stat_record()->invocations++;
  95 
  96   // Capture heap size before collection for printing.
  97   size_t gch_prev_used = gch->used();
  98 
  99   // Some of the card table updates below assume that the perm gen is
 100   // also being collected.
 101   assert(level == gch->n_gens() - 1,
 102          "All generations are being collected, ergo perm gen too.");
 103 
 104   // Capture used regions for each generation that will be
 105   // subject to collection, so that card table adjustments can
 106   // be made intelligently (see clear / invalidate further below).
 107   gch->save_used_regions(level, true /* perm */);
 108 
 109   allocate_stacks();
 110 
 111   mark_sweep_phase1(level, clear_all_softrefs);
 112 
 113   gc_tracer()->report_class_count_after_gc(&is_alive);
 114 
 115   mark_sweep_phase2();
 116 
 117   // Don't add any more derived pointers during phase3
 118   COMPILER2_PRESENT(assert(DerivedPointerTable::is_active(), "Sanity"));
 119   COMPILER2_PRESENT(DerivedPointerTable::set_active(false));
 120 
 121   mark_sweep_phase3(level);
 122 
 123   VALIDATE_MARK_SWEEP_ONLY(
 124     if (ValidateMarkSweep) {
 125       guarantee(_root_refs_stack->length() == 0, "should be empty by now");
 126     }
 127   )
 128 
 129   mark_sweep_phase4();
 130 
 131   VALIDATE_MARK_SWEEP_ONLY(
 132     if (ValidateMarkSweep) {
 133       guarantee(_live_oops->length() == _live_oops_moved_to->length(),
 134                 "should be the same size");