< prev index next >

src/hotspot/share/gc/g1/g1DefaultPolicy.cpp

Print this page




  81 
  82   assert(Heap_lock->owned_by_self(), "Locking discipline.");
  83 
  84   if (!adaptive_young_list_length()) {
  85     _young_list_fixed_length = _young_gen_sizer.min_desired_young_length();
  86   }
  87   _young_gen_sizer.adjust_max_new_size(_g1->max_regions());
  88 
  89   _free_regions_at_end_of_collection = _g1->num_free_regions();
  90 
  91   update_young_list_max_and_target_length();
  92   // We may immediately start allocating regions and placing them on the
  93   // collection set list. Initialize the per-collection set info
  94   _collection_set->start_incremental_building();
  95 }
  96 
  97 void G1DefaultPolicy::note_gc_start() {
  98   phase_times()->note_gc_start();
  99 }
 100 
 101 class G1YoungLengthPredictor VALUE_OBJ_CLASS_SPEC {
 102   const bool _during_cm;
 103   const double _base_time_ms;
 104   const double _base_free_regions;
 105   const double _target_pause_time_ms;
 106   const G1DefaultPolicy* const _policy;
 107 
 108  public:
 109   G1YoungLengthPredictor(bool during_cm,
 110                          double base_time_ms,
 111                          double base_free_regions,
 112                          double target_pause_time_ms,
 113                          const G1DefaultPolicy* policy) :
 114     _during_cm(during_cm),
 115     _base_time_ms(base_time_ms),
 116     _base_free_regions(base_free_regions),
 117     _target_pause_time_ms(target_pause_time_ms),
 118     _policy(policy) {}
 119 
 120   bool will_fit(uint young_length) const {
 121     if (young_length >= _base_free_regions) {




  81 
  82   assert(Heap_lock->owned_by_self(), "Locking discipline.");
  83 
  84   if (!adaptive_young_list_length()) {
  85     _young_list_fixed_length = _young_gen_sizer.min_desired_young_length();
  86   }
  87   _young_gen_sizer.adjust_max_new_size(_g1->max_regions());
  88 
  89   _free_regions_at_end_of_collection = _g1->num_free_regions();
  90 
  91   update_young_list_max_and_target_length();
  92   // We may immediately start allocating regions and placing them on the
  93   // collection set list. Initialize the per-collection set info
  94   _collection_set->start_incremental_building();
  95 }
  96 
  97 void G1DefaultPolicy::note_gc_start() {
  98   phase_times()->note_gc_start();
  99 }
 100 
 101 class G1YoungLengthPredictor {
 102   const bool _during_cm;
 103   const double _base_time_ms;
 104   const double _base_free_regions;
 105   const double _target_pause_time_ms;
 106   const G1DefaultPolicy* const _policy;
 107 
 108  public:
 109   G1YoungLengthPredictor(bool during_cm,
 110                          double base_time_ms,
 111                          double base_free_regions,
 112                          double target_pause_time_ms,
 113                          const G1DefaultPolicy* policy) :
 114     _during_cm(during_cm),
 115     _base_time_ms(base_time_ms),
 116     _base_free_regions(base_free_regions),
 117     _target_pause_time_ms(target_pause_time_ms),
 118     _policy(policy) {}
 119 
 120   bool will_fit(uint young_length) const {
 121     if (young_length >= _base_free_regions) {


< prev index next >