src/share/vm/gc_implementation/g1/g1MarkSweep.cpp

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


  74 
  75   // When collecting the permanent generation methodOops may be moving,
  76   // so we either have to flush all bcp data or convert it into bci.
  77   CodeCache::gc_prologue();
  78   Threads::gc_prologue();
  79 
  80   // Increment the invocation count for the permanent generation, since it is
  81   // implicitly collected whenever we do a full mark sweep collection.
  82   sh->perm_gen()->stat_record()->invocations++;
  83 
  84   bool marked_for_unloading = false;
  85 
  86   allocate_stacks();
  87 
  88   // We should save the marks of the currently locked biased monitors.
  89   // The marking doesn't preserve the marks of biased objects.
  90   BiasedLocking::preserve_marks();
  91 
  92   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
  93 


  94   mark_sweep_phase2();
  95 
  96   // Don't add any more derived pointers during phase3
  97   COMPILER2_PRESENT(DerivedPointerTable::set_active(false));
  98 
  99   mark_sweep_phase3();
 100 
 101   mark_sweep_phase4();
 102 
 103   GenMarkSweep::restore_marks();
 104   BiasedLocking::restore_marks();
 105   GenMarkSweep::deallocate_stacks();
 106 
 107   // We must invalidate the perm-gen rs, so that it gets rebuilt.
 108   GenRemSet* rs = sh->rem_set();
 109   rs->invalidate(sh->perm_gen()->used_region(), true /*whole_heap*/);
 110 
 111   // "free at last gc" is calculated from these.
 112   // CHF: cheating for now!!!
 113   //  Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity());




  74 
  75   // When collecting the permanent generation methodOops may be moving,
  76   // so we either have to flush all bcp data or convert it into bci.
  77   CodeCache::gc_prologue();
  78   Threads::gc_prologue();
  79 
  80   // Increment the invocation count for the permanent generation, since it is
  81   // implicitly collected whenever we do a full mark sweep collection.
  82   sh->perm_gen()->stat_record()->invocations++;
  83 
  84   bool marked_for_unloading = false;
  85 
  86   allocate_stacks();
  87 
  88   // We should save the marks of the currently locked biased monitors.
  89   // The marking doesn't preserve the marks of biased objects.
  90   BiasedLocking::preserve_marks();
  91 
  92   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
  93 
  94   gc_tracer()->report_class_count_after_gc(&GenMarkSweep::is_alive);
  95 
  96   mark_sweep_phase2();
  97 
  98   // Don't add any more derived pointers during phase3
  99   COMPILER2_PRESENT(DerivedPointerTable::set_active(false));
 100 
 101   mark_sweep_phase3();
 102 
 103   mark_sweep_phase4();
 104 
 105   GenMarkSweep::restore_marks();
 106   BiasedLocking::restore_marks();
 107   GenMarkSweep::deallocate_stacks();
 108 
 109   // We must invalidate the perm-gen rs, so that it gets rebuilt.
 110   GenRemSet* rs = sh->rem_set();
 111   rs->invalidate(sh->perm_gen()->used_region(), true /*whole_heap*/);
 112 
 113   // "free at last gc" is calculated from these.
 114   // CHF: cheating for now!!!
 115   //  Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity());