Mon, 09 Feb 2009 17:33:06 +0300
6802413: G1: G1FixedSurvivorSpaceSize should be converted into regions in calculate_survivors_policy()
Reviewed-by: tonyp, jmasa
src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Sun Feb 08 13:18:01 2009 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Mon Feb 09 17:33:06 2009 +0300 1.3 @@ -280,7 +280,7 @@ 1.4 if (G1UseSurvivorSpace) { 1.5 // if G1FixedSurvivorSpaceSize is 0 which means the size is not 1.6 // fixed, then _max_survivor_regions will be calculated at 1.7 - // calculate_young_list_target_config diring initialization 1.8 + // calculate_young_list_target_config during initialization 1.9 _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes; 1.10 } else { 1.11 _max_survivor_regions = 0; 1.12 @@ -297,6 +297,9 @@ 1.13 void G1CollectorPolicy::initialize_flags() { 1.14 set_min_alignment(HeapRegion::GrainBytes); 1.15 set_max_alignment(GenRemSet::max_alignment_constraint(rem_set_name())); 1.16 + if (SurvivorRatio < 1) { 1.17 + vm_exit_during_initialization("Invalid survivor ratio specified"); 1.18 + } 1.19 CollectorPolicy::initialize_flags(); 1.20 } 1.21 1.22 @@ -2770,7 +2773,7 @@ 1.23 if (G1FixedSurvivorSpaceSize == 0) { 1.24 _max_survivor_regions = _young_list_target_length / SurvivorRatio; 1.25 } else { 1.26 - _max_survivor_regions = G1FixedSurvivorSpaceSize; 1.27 + _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes; 1.28 } 1.29 1.30 if (G1FixedTenuringThreshold) {