Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 1391:79e419e5ea3b
6942253: G1: replace G1ParallelGCAllocBufferSize with YoungPLABSize and OldPLABSize
Summary: Replaces the G1-specific parameter with the existing ones that are used by the other GCs (YoungPLABSize and OldPLABSize)
Reviewed-by: tonyp, johnc
author | apetrusenko |
---|---|
date | Fri, 16 Apr 2010 08:48:16 -0700 |
parents | f9ec1e4bbb44 |
children | 1316cec51b4d |
comparison
equal
deleted
inserted
replaced
1390:f9ec1e4bbb44 | 1391:79e419e5ea3b |
---|---|
2943 (G1SummarizeRSetStatsPeriod > 0) && | 2943 (G1SummarizeRSetStatsPeriod > 0) && |
2944 (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { | 2944 (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { |
2945 g1_rem_set()->print_summary_info(); | 2945 g1_rem_set()->print_summary_info(); |
2946 } | 2946 } |
2947 } | 2947 } |
2948 | |
2949 size_t G1CollectedHeap::desired_plab_sz(GCAllocPurpose purpose) | |
2950 { | |
2951 size_t gclab_word_size; | |
2952 switch (purpose) { | |
2953 case GCAllocForSurvived: | |
2954 gclab_word_size = YoungPLABSize; | |
2955 break; | |
2956 case GCAllocForTenured: | |
2957 gclab_word_size = OldPLABSize; | |
2958 break; | |
2959 default: | |
2960 assert(false, "unknown GCAllocPurpose"); | |
2961 gclab_word_size = OldPLABSize; | |
2962 break; | |
2963 } | |
2964 return gclab_word_size; | |
2965 } | |
2966 | |
2948 | 2967 |
2949 void G1CollectedHeap::set_gc_alloc_region(int purpose, HeapRegion* r) { | 2968 void G1CollectedHeap::set_gc_alloc_region(int purpose, HeapRegion* r) { |
2950 assert(purpose >= 0 && purpose < GCAllocPurposeCount, "invalid purpose"); | 2969 assert(purpose >= 0 && purpose < GCAllocPurposeCount, "invalid purpose"); |
2951 // make sure we don't call set_gc_alloc_region() multiple times on | 2970 // make sure we don't call set_gc_alloc_region() multiple times on |
2952 // the same region | 2971 // the same region |
3678 _dcq(&g1h->dirty_card_queue_set()), | 3697 _dcq(&g1h->dirty_card_queue_set()), |
3679 _ct_bs((CardTableModRefBS*)_g1h->barrier_set()), | 3698 _ct_bs((CardTableModRefBS*)_g1h->barrier_set()), |
3680 _g1_rem(g1h->g1_rem_set()), | 3699 _g1_rem(g1h->g1_rem_set()), |
3681 _hash_seed(17), _queue_num(queue_num), | 3700 _hash_seed(17), _queue_num(queue_num), |
3682 _term_attempts(0), | 3701 _term_attempts(0), |
3702 _surviving_alloc_buffer(g1h->desired_plab_sz(GCAllocForSurvived)), | |
3703 _tenured_alloc_buffer(g1h->desired_plab_sz(GCAllocForTenured)), | |
3683 _age_table(false), | 3704 _age_table(false), |
3684 #if G1_DETAILED_STATS | 3705 #if G1_DETAILED_STATS |
3685 _pushes(0), _pops(0), _steals(0), | 3706 _pushes(0), _pops(0), _steals(0), |
3686 _steal_attempts(0), _overflow_pushes(0), | 3707 _steal_attempts(0), _overflow_pushes(0), |
3687 #endif | 3708 #endif |
3703 "Not enough space for young surv histo."); | 3724 "Not enough space for young surv histo."); |
3704 _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM; | 3725 _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM; |
3705 memset(_surviving_young_words, 0, real_length * sizeof(size_t)); | 3726 memset(_surviving_young_words, 0, real_length * sizeof(size_t)); |
3706 | 3727 |
3707 _overflowed_refs = new OverflowQueue(10); | 3728 _overflowed_refs = new OverflowQueue(10); |
3729 | |
3730 _alloc_buffers[GCAllocForSurvived] = &_surviving_alloc_buffer; | |
3731 _alloc_buffers[GCAllocForTenured] = &_tenured_alloc_buffer; | |
3708 | 3732 |
3709 _start = os::elapsedTime(); | 3733 _start = os::elapsedTime(); |
3710 } | 3734 } |
3711 | 3735 |
3712 G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : | 3736 G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : |