Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 6611:7383557659bd
7185699: G1: Prediction model discrepancies
Summary: Correct the result value of G1CollectedHeap::pending_card_num(). Change the code that calculates the GC efficiency of a non-young heap region to use historical data from mixed GCs and the actual number of live bytes when predicting how long it would take to collect the region. Changes were also reviewed by Thomas Schatzl.
Reviewed-by: azeemj, brutisso
author | johnc |
---|---|
date | Tue, 21 Aug 2012 14:10:39 -0700 |
parents | a2f7274eb6ef |
children | c38f13903fdf da91efe96a93 |
comparison
equal
deleted
inserted
replaced
6610:f99a36499b8c | 6611:7383557659bd |
---|---|
382 (CardTableModRefBS*)G1CollectedHeap::heap()->barrier_set(); | 382 (CardTableModRefBS*)G1CollectedHeap::heap()->barrier_set(); |
383 ct_bs->clear(MemRegion(bottom(), end())); | 383 ct_bs->clear(MemRegion(bottom(), end())); |
384 } | 384 } |
385 | 385 |
386 void HeapRegion::calc_gc_efficiency() { | 386 void HeapRegion::calc_gc_efficiency() { |
387 // GC efficiency is the ratio of how much space would be | |
388 // reclaimed over how long we predict it would take to reclaim it. | |
387 G1CollectedHeap* g1h = G1CollectedHeap::heap(); | 389 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
388 G1CollectorPolicy* g1p = g1h->g1_policy(); | 390 G1CollectorPolicy* g1p = g1h->g1_policy(); |
389 _gc_efficiency = (double) reclaimable_bytes() / | 391 |
390 g1p->predict_region_elapsed_time_ms(this, false); | 392 // Retrieve a prediction of the elapsed time for this region for |
393 // a mixed gc because the region will only be evacuated during a | |
394 // mixed gc. | |
395 double region_elapsed_time_ms = | |
396 g1p->predict_region_elapsed_time_ms(this, false /* for_young_gc */); | |
397 _gc_efficiency = (double) reclaimable_bytes() / region_elapsed_time_ms; | |
391 } | 398 } |
392 | 399 |
393 void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) { | 400 void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) { |
394 assert(!isHumongous(), "sanity / pre-condition"); | 401 assert(!isHumongous(), "sanity / pre-condition"); |
395 assert(end() == _orig_end, | 402 assert(end() == _orig_end, |