changeset 547:1e458753107d

6802413: G1: G1FixedSurvivorSpaceSize should be converted into regions in calculate_survivors_policy() Reviewed-by: tonyp, jmasa
author apetrusenko
date Mon, 09 Feb 2009 17:33:06 +0300
parents 05c6d52fa7a9
children 773234c55e8c
files src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Sun Feb 08 13:18:01 2009 -0800
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Mon Feb 09 17:33:06 2009 +0300
@@ -280,7 +280,7 @@
   if (G1UseSurvivorSpace) {
     // if G1FixedSurvivorSpaceSize is 0 which means the size is not
     // fixed, then _max_survivor_regions will be calculated at
-    // calculate_young_list_target_config diring initialization
+    // calculate_young_list_target_config during initialization
     _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes;
   } else {
     _max_survivor_regions = 0;
@@ -297,6 +297,9 @@
 void G1CollectorPolicy::initialize_flags() {
   set_min_alignment(HeapRegion::GrainBytes);
   set_max_alignment(GenRemSet::max_alignment_constraint(rem_set_name()));
+  if (SurvivorRatio < 1) {
+    vm_exit_during_initialization("Invalid survivor ratio specified");
+  }
   CollectorPolicy::initialize_flags();
 }
 
@@ -2770,7 +2773,7 @@
   if (G1FixedSurvivorSpaceSize == 0) {
     _max_survivor_regions = _young_list_target_length / SurvivorRatio;
   } else {
-    _max_survivor_regions = G1FixedSurvivorSpaceSize;
+    _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes;
   }
 
   if (G1FixedTenuringThreshold) {