src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp

changeset 2333
016a3628c885
parent 2315
631f79e71e90
child 2472
0fa27f37d4d4
     1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Thu Dec 02 13:20:39 2010 -0500
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Dec 07 16:47:42 2010 -0500
     1.3 @@ -479,6 +479,7 @@
     1.4    // region before we need to do a collection again.
     1.5    size_t min_length = _g1->young_list()->length() + 1;
     1.6    _young_list_target_length = MAX2(_young_list_target_length, min_length);
     1.7 +  calculate_max_gc_locker_expansion();
     1.8    calculate_survivors_policy();
     1.9  }
    1.10  
    1.11 @@ -2301,6 +2302,21 @@
    1.12    };
    1.13  }
    1.14  
    1.15 +void G1CollectorPolicy::calculate_max_gc_locker_expansion() {
    1.16 +  size_t expansion_region_num = 0;
    1.17 +  if (GCLockerEdenExpansionPercent > 0) {
    1.18 +    double perc = (double) GCLockerEdenExpansionPercent / 100.0;
    1.19 +    double expansion_region_num_d = perc * (double) _young_list_target_length;
    1.20 +    // We use ceiling so that if expansion_region_num_d is > 0.0 (but
    1.21 +    // less than 1.0) we'll get 1.
    1.22 +    expansion_region_num = (size_t) ceil(expansion_region_num_d);
    1.23 +  } else {
    1.24 +    assert(expansion_region_num == 0, "sanity");
    1.25 +  }
    1.26 +  _young_list_max_length = _young_list_target_length + expansion_region_num;
    1.27 +  assert(_young_list_target_length <= _young_list_max_length, "post-condition");
    1.28 +}
    1.29 +
    1.30  // Calculates survivor space parameters.
    1.31  void G1CollectorPolicy::calculate_survivors_policy()
    1.32  {

mercurial