aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/gc_implementation
diff options
context:
space:
mode:
authorapetrusenko <none@none>2009-02-09 17:33:06 +0300
committerapetrusenko <none@none>2009-02-09 17:33:06 +0300
commit5ec78c0b7a1f54c9e2c8fdc719377d45f26b6343 (patch)
tree5b5e52e0063f326e58366d3e544c839cfebba189 /src/share/vm/gc_implementation
parentfdeb5e6a6d5aa02f88759dff40b3512334e51e86 (diff)
downloadjdk8u_hotspot-5ec78c0b7a1f54c9e2c8fdc719377d45f26b6343.tar.gz
6802413: G1: G1FixedSurvivorSpaceSize should be converted into regions in calculate_survivors_policy()
Reviewed-by: tonyp, jmasa
Diffstat (limited to 'src/share/vm/gc_implementation')
-rw-r--r--src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index 6c5bbe075..949e3f997 100644
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -280,7 +280,7 @@ G1CollectorPolicy::G1CollectorPolicy() :
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 @@ static void inc_mod(int& i, int len) {
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 @@ void G1CollectorPolicy::calculate_survivors_policy()
if (G1FixedSurvivorSpaceSize == 0) {
_max_survivor_regions = _young_list_target_length / SurvivorRatio;
} else {
- _max_survivor_regions = G1FixedSurvivorSpaceSize;
+ _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes;
}
if (G1FixedTenuringThreshold) {