hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp
changeset 31358 693058672cc6
parent 30764 fec48bf5a827
child 31592 43f48e165466
equal deleted inserted replaced
31357:0cef600ba9b7 31358:693058672cc6
    39 #if INCLUDE_ALL_GCS
    39 #if INCLUDE_ALL_GCS
    40 #include "gc/cms/parOopClosures.hpp"
    40 #include "gc/cms/parOopClosures.hpp"
    41 #endif
    41 #endif
    42 
    42 
    43 TenuredGeneration::TenuredGeneration(ReservedSpace rs,
    43 TenuredGeneration::TenuredGeneration(ReservedSpace rs,
    44                                      size_t initial_byte_size, int level,
    44                                      size_t initial_byte_size,
    45                                      GenRemSet* remset) :
    45                                      GenRemSet* remset) :
    46   CardGeneration(rs, initial_byte_size, level, remset)
    46   CardGeneration(rs, initial_byte_size, remset)
    47 {
    47 {
    48   HeapWord* bottom = (HeapWord*) _virtual_space.low();
    48   HeapWord* bottom = (HeapWord*) _virtual_space.low();
    49   HeapWord* end    = (HeapWord*) _virtual_space.high();
    49   HeapWord* end    = (HeapWord*) _virtual_space.high();
    50   _the_space  = new TenuredSpace(_bts, MemRegion(bottom, end));
    50   _the_space  = new TenuredSpace(_bts, MemRegion(bottom, end));
    51   _the_space->reset_saved_mark();
    51   _the_space->reset_saved_mark();
   132   assert(used() == used_after_gc && used_after_gc <= capacity(),
   132   assert(used() == used_after_gc && used_after_gc <= capacity(),
   133          err_msg("used: " SIZE_FORMAT " used_after_gc: " SIZE_FORMAT
   133          err_msg("used: " SIZE_FORMAT " used_after_gc: " SIZE_FORMAT
   134          " capacity: " SIZE_FORMAT, used(), used_after_gc, capacity()));
   134          " capacity: " SIZE_FORMAT, used(), used_after_gc, capacity()));
   135 }
   135 }
   136 
   136 
   137 void TenuredGeneration::update_gc_stats(int current_level,
   137 void TenuredGeneration::update_gc_stats(Generation* current_generation,
   138                                         bool full) {
   138                                         bool full) {
   139   // If the next lower level(s) has been collected, gather any statistics
   139   // If the young generation has been collected, gather any statistics
   140   // that are of interest at this point.
   140   // that are of interest at this point.
   141   if (!full && (current_level + 1) == level()) {
   141   bool current_is_young = GenCollectedHeap::heap()->is_young_gen(current_generation);
       
   142   if (!full && current_is_young) {
   142     // Calculate size of data promoted from the younger generations
   143     // Calculate size of data promoted from the younger generations
   143     // before doing the collection.
   144     // before doing the collection.
   144     size_t used_before_gc = used();
   145     size_t used_before_gc = used();
   145 
   146 
   146     // If the younger gen collections were skipped, then the
   147     // If the younger gen collections were skipped, then the
   190   gc_timer->register_gc_start();
   191   gc_timer->register_gc_start();
   191 
   192 
   192   SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
   193   SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
   193   gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
   194   gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
   194 
   195 
   195   GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
   196   GenMarkSweep::invoke_at_safepoint(ref_processor(), clear_all_soft_refs);
   196 
   197 
   197   gc_timer->register_gc_end();
   198   gc_timer->register_gc_end();
   198 
   199 
   199   gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
   200   gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
   200 }
   201 }