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

changeset 3998
7383557659bd
parent 3957
a2f7274eb6ef
child 4037
da91efe96a93
     1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Tue Aug 21 10:05:57 2012 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Tue Aug 21 14:10:39 2012 -0700
     1.3 @@ -384,10 +384,17 @@
     1.4  }
     1.5  
     1.6  void HeapRegion::calc_gc_efficiency() {
     1.7 +  // GC efficiency is the ratio of how much space would be
     1.8 +  // reclaimed over how long we predict it would take to reclaim it.
     1.9    G1CollectedHeap* g1h = G1CollectedHeap::heap();
    1.10    G1CollectorPolicy* g1p = g1h->g1_policy();
    1.11 -  _gc_efficiency = (double) reclaimable_bytes() /
    1.12 -                            g1p->predict_region_elapsed_time_ms(this, false);
    1.13 +
    1.14 +  // Retrieve a prediction of the elapsed time for this region for
    1.15 +  // a mixed gc because the region will only be evacuated during a
    1.16 +  // mixed gc.
    1.17 +  double region_elapsed_time_ms =
    1.18 +    g1p->predict_region_elapsed_time_ms(this, false /* for_young_gc */);
    1.19 +  _gc_efficiency = (double) reclaimable_bytes() / region_elapsed_time_ms;
    1.20  }
    1.21  
    1.22  void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) {

mercurial