Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 4912:a9647476d1a4
7132029: G1: mixed GC phase lasts for longer than it should
Summary: Revamp of the mechanism that chooses old regions for inclusion in the CSet. It simplifies the code and introduces min and max bounds on the number of old regions added to the CSet at each mixed GC to avoid pathological cases. It also ensures that when we do a mixed GC we'll always find old regions to add to the CSet (i.e., it eliminates the case where a mixed GC will collect no old regions which can happen today).
Reviewed-by: johnc, brutisso
author | tonyp |
---|---|
date | Wed, 15 Feb 2012 13:06:53 -0500 |
parents | b4ebad3520bb |
children | 33df1aeaebbf b632e80fc9dc |
comparison
equal
deleted
inserted
replaced
4911:d903bf750e9f | 4912:a9647476d1a4 |
---|---|
385 CardTableModRefBS* ct_bs = | 385 CardTableModRefBS* ct_bs = |
386 (CardTableModRefBS*)G1CollectedHeap::heap()->barrier_set(); | 386 (CardTableModRefBS*)G1CollectedHeap::heap()->barrier_set(); |
387 ct_bs->clear(MemRegion(bottom(), end())); | 387 ct_bs->clear(MemRegion(bottom(), end())); |
388 } | 388 } |
389 | 389 |
390 // <PREDICTION> | |
391 void HeapRegion::calc_gc_efficiency() { | 390 void HeapRegion::calc_gc_efficiency() { |
392 G1CollectedHeap* g1h = G1CollectedHeap::heap(); | 391 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
393 _gc_efficiency = (double) garbage_bytes() / | 392 G1CollectorPolicy* g1p = g1h->g1_policy(); |
394 g1h->predict_region_elapsed_time_ms(this, false); | 393 _gc_efficiency = (double) reclaimable_bytes() / |
395 } | 394 g1p->predict_region_elapsed_time_ms(this, false); |
396 // </PREDICTION> | 395 } |
397 | 396 |
398 void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) { | 397 void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) { |
399 assert(!isHumongous(), "sanity / pre-condition"); | 398 assert(!isHumongous(), "sanity / pre-condition"); |
400 assert(end() == _orig_end, | 399 assert(end() == _orig_end, |
401 "Should be normal before the humongous object allocation"); | 400 "Should be normal before the humongous object allocation"); |