Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20215:983092f35ff7
8028710: G1 does not retire allocation buffers after reference processing work
Summary: G1 does not retire allocation buffers after reference processing work when -XX:+ParallelRefProcEnabled is enabled. This causes wrong calculation of PLAB sizes, as the amount of space wasted is not updated correctly.
Reviewed-by: brutisso
author | tschatzl |
---|---|
date | Mon, 21 Jul 2014 09:40:19 +0200 |
parents | d7e2d5f2846b |
children | 570cb6369f17 |
comparison
equal
deleted
inserted
replaced
20214:8cc89a893545 | 20215:983092f35ff7 |
---|---|
4569 // Trying to keep some compilers happy. | 4569 // Trying to keep some compilers happy. |
4570 return NULL; | 4570 return NULL; |
4571 } | 4571 } |
4572 | 4572 |
4573 G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) : | 4573 G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) : |
4574 ParGCAllocBuffer(gclab_word_size), _retired(false) { } | 4574 ParGCAllocBuffer(gclab_word_size), _retired(true) { } |
4575 | 4575 |
4576 G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp) | 4576 G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp) |
4577 : _g1h(g1h), | 4577 : _g1h(g1h), |
4578 _refs(g1h->task_queue(queue_num)), | 4578 _refs(g1h->task_queue(queue_num)), |
4579 _dcq(&g1h->dirty_card_queue_set()), | 4579 _dcq(&g1h->dirty_card_queue_set()), |
4933 // available new entries on the queues. So we have to make sure | 4933 // available new entries on the queues. So we have to make sure |
4934 // we drain the queues as necessary. | 4934 // we drain the queues as necessary. |
4935 pss->trim_queue(); | 4935 pss->trim_queue(); |
4936 } | 4936 } |
4937 } while (!offer_termination()); | 4937 } while (!offer_termination()); |
4938 | |
4939 pss->retire_alloc_buffers(); | |
4940 } | 4938 } |
4941 | 4939 |
4942 class G1KlassScanClosure : public KlassClosure { | 4940 class G1KlassScanClosure : public KlassClosure { |
4943 G1ParCopyHelper* _closure; | 4941 G1ParCopyHelper* _closure; |
4944 bool _process_only_dirty; | 4942 bool _process_only_dirty; |
5774 _gc_timer_stw, | 5772 _gc_timer_stw, |
5775 _gc_tracer_stw->gc_id()); | 5773 _gc_tracer_stw->gc_id()); |
5776 } | 5774 } |
5777 | 5775 |
5778 _gc_tracer_stw->report_gc_reference_stats(stats); | 5776 _gc_tracer_stw->report_gc_reference_stats(stats); |
5779 // We have completed copying any necessary live referent objects | 5777 |
5780 // (that were not copied during the actual pause) so we can | 5778 // We have completed copying any necessary live referent objects. |
5781 // retire any active alloc buffers | |
5782 pss.retire_alloc_buffers(); | |
5783 assert(pss.refs()->is_empty(), "both queue and overflow should be empty"); | 5779 assert(pss.refs()->is_empty(), "both queue and overflow should be empty"); |
5784 | 5780 |
5785 double ref_proc_time = os::elapsedTime() - ref_proc_start; | 5781 double ref_proc_time = os::elapsedTime() - ref_proc_start; |
5786 g1_policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0); | 5782 g1_policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0); |
5787 } | 5783 } |