hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp
changeset 33130 a776072941e8
parent 33105 294e48b4f704
child 33204 b8a3901ac5b3
equal deleted inserted replaced
33129:e0bcbb5015b3 33130:a776072941e8
   153     return _min_desired_young_length;
   153     return _min_desired_young_length;
   154   }
   154   }
   155   uint max_desired_young_length() {
   155   uint max_desired_young_length() {
   156     return _max_desired_young_length;
   156     return _max_desired_young_length;
   157   }
   157   }
   158   bool adaptive_young_list_length() {
   158   bool adaptive_young_list_length() const {
   159     return _adaptive_size;
   159     return _adaptive_size;
   160   }
   160   }
   161 };
   161 };
   162 
   162 
   163 class G1CollectorPolicy: public CollectorPolicy {
   163 class G1CollectorPolicy: public CollectorPolicy {
   240   uint _old_cset_region_length;
   240   uint _old_cset_region_length;
   241 
   241 
   242   void init_cset_region_lengths(uint eden_cset_region_length,
   242   void init_cset_region_lengths(uint eden_cset_region_length,
   243                                 uint survivor_cset_region_length);
   243                                 uint survivor_cset_region_length);
   244 
   244 
   245   uint eden_cset_region_length()     { return _eden_cset_region_length;     }
   245   uint eden_cset_region_length() const     { return _eden_cset_region_length;     }
   246   uint survivor_cset_region_length() { return _survivor_cset_region_length; }
   246   uint survivor_cset_region_length() const { return _survivor_cset_region_length; }
   247   uint old_cset_region_length()      { return _old_cset_region_length;      }
   247   uint old_cset_region_length() const      { return _old_cset_region_length;      }
   248 
   248 
   249   uint _free_regions_at_end_of_collection;
   249   uint _free_regions_at_end_of_collection;
   250 
   250 
   251   size_t _recorded_rs_lengths;
   251   size_t _recorded_rs_lengths;
   252   size_t _max_rs_lengths;
   252   size_t _max_rs_lengths;
   253   double _sigma;
   253   double _sigma;
   254 
   254 
   255   size_t _rs_lengths_prediction;
   255   size_t _rs_lengths_prediction;
   256 
   256 
   257   double sigma() { return _sigma; }
   257   double sigma() const { return _sigma; }
   258 
   258 
   259   // A function that prevents us putting too much stock in small sample
   259   // A function that prevents us putting too much stock in small sample
   260   // sets.  Returns a number between 2.0 and 1.0, depending on the number
   260   // sets.  Returns a number between 2.0 and 1.0, depending on the number
   261   // of samples.  5 or more samples yields one; fewer scales linearly from
   261   // of samples.  5 or more samples yields one; fewer scales linearly from
   262   // 2.0 at 1 sample to 1.0 at 5.
   262   // 2.0 at 1 sample to 1.0 at 5.
   263   double confidence_factor(int samples) {
   263   double confidence_factor(int samples) const {
   264     if (samples > 4) return 1.0;
   264     if (samples > 4) return 1.0;
   265     else return  1.0 + sigma() * ((double)(5 - samples))/2.0;
   265     else return  1.0 + sigma() * ((double)(5 - samples))/2.0;
   266   }
   266   }
   267 
   267 
   268   double get_new_neg_prediction(TruncatedSeq* seq) {
   268   double get_new_neg_prediction(TruncatedSeq* seq) {
   301 
   301 
   302 #ifndef PRODUCT
   302 #ifndef PRODUCT
   303   bool verify_young_ages();
   303   bool verify_young_ages();
   304 #endif // PRODUCT
   304 #endif // PRODUCT
   305 
   305 
   306   double get_new_prediction(TruncatedSeq* seq) {
   306   double get_new_prediction(TruncatedSeq* seq) const {
   307     return MAX2(seq->davg() + sigma() * seq->dsd(),
   307     return MAX2(seq->davg() + sigma() * seq->dsd(),
   308                 seq->davg() * confidence_factor(seq->num()));
   308                 seq->davg() * confidence_factor(seq->num()));
   309   }
   309   }
   310 
   310 
   311   void record_max_rs_lengths(size_t rs_lengths) {
   311   void record_max_rs_lengths(size_t rs_lengths) {
   312     _max_rs_lengths = rs_lengths;
   312     _max_rs_lengths = rs_lengths;
   313   }
   313   }
   314 
   314 
   315   size_t predict_rs_length_diff() {
   315   size_t predict_rs_length_diff() const {
   316     return (size_t) get_new_prediction(_rs_length_diff_seq);
   316     return (size_t) get_new_prediction(_rs_length_diff_seq);
   317   }
   317   }
   318 
   318 
   319   double predict_alloc_rate_ms() {
   319   double predict_alloc_rate_ms() const {
   320     return get_new_prediction(_alloc_rate_ms_seq);
   320     return get_new_prediction(_alloc_rate_ms_seq);
   321   }
   321   }
   322 
   322 
   323   double predict_cost_per_card_ms() {
   323   double predict_cost_per_card_ms() const {
   324     return get_new_prediction(_cost_per_card_ms_seq);
   324     return get_new_prediction(_cost_per_card_ms_seq);
   325   }
   325   }
   326 
   326 
   327   double predict_rs_update_time_ms(size_t pending_cards) {
   327   double predict_rs_update_time_ms(size_t pending_cards) const {
   328     return (double) pending_cards * predict_cost_per_card_ms();
   328     return (double) pending_cards * predict_cost_per_card_ms();
   329   }
   329   }
   330 
   330 
   331   double predict_young_cards_per_entry_ratio() {
   331   double predict_young_cards_per_entry_ratio() const {
   332     return get_new_prediction(_young_cards_per_entry_ratio_seq);
   332     return get_new_prediction(_young_cards_per_entry_ratio_seq);
   333   }
   333   }
   334 
   334 
   335   double predict_mixed_cards_per_entry_ratio() {
   335   double predict_mixed_cards_per_entry_ratio() const {
   336     if (_mixed_cards_per_entry_ratio_seq->num() < 2) {
   336     if (_mixed_cards_per_entry_ratio_seq->num() < 2) {
   337       return predict_young_cards_per_entry_ratio();
   337       return predict_young_cards_per_entry_ratio();
   338     } else {
   338     } else {
   339       return get_new_prediction(_mixed_cards_per_entry_ratio_seq);
   339       return get_new_prediction(_mixed_cards_per_entry_ratio_seq);
   340     }
   340     }
   341   }
   341   }
   342 
   342 
   343   size_t predict_young_card_num(size_t rs_length) {
   343   size_t predict_young_card_num(size_t rs_length) const {
   344     return (size_t) ((double) rs_length *
   344     return (size_t) ((double) rs_length *
   345                      predict_young_cards_per_entry_ratio());
   345                      predict_young_cards_per_entry_ratio());
   346   }
   346   }
   347 
   347 
   348   size_t predict_non_young_card_num(size_t rs_length) {
   348   size_t predict_non_young_card_num(size_t rs_length) const {
   349     return (size_t) ((double) rs_length *
   349     return (size_t) ((double) rs_length *
   350                      predict_mixed_cards_per_entry_ratio());
   350                      predict_mixed_cards_per_entry_ratio());
   351   }
   351   }
   352 
   352 
   353   double predict_rs_scan_time_ms(size_t card_num) {
   353   double predict_rs_scan_time_ms(size_t card_num) const {
   354     if (collector_state()->gcs_are_young()) {
   354     if (collector_state()->gcs_are_young()) {
   355       return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq);
   355       return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq);
   356     } else {
   356     } else {
   357       return predict_mixed_rs_scan_time_ms(card_num);
   357       return predict_mixed_rs_scan_time_ms(card_num);
   358     }
   358     }
   359   }
   359   }
   360 
   360 
   361   double predict_mixed_rs_scan_time_ms(size_t card_num) {
   361   double predict_mixed_rs_scan_time_ms(size_t card_num) const {
   362     if (_mixed_cost_per_entry_ms_seq->num() < 3) {
   362     if (_mixed_cost_per_entry_ms_seq->num() < 3) {
   363       return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq);
   363       return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq);
   364     } else {
   364     } else {
   365       return (double) (card_num *
   365       return (double) (card_num *
   366                        get_new_prediction(_mixed_cost_per_entry_ms_seq));
   366                        get_new_prediction(_mixed_cost_per_entry_ms_seq));
   367     }
   367     }
   368   }
   368   }
   369 
   369 
   370   double predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) {
   370   double predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) const {
   371     if (_cost_per_byte_ms_during_cm_seq->num() < 3) {
   371     if (_cost_per_byte_ms_during_cm_seq->num() < 3) {
   372       return (1.1 * (double) bytes_to_copy) *
   372       return (1.1 * (double) bytes_to_copy) *
   373               get_new_prediction(_cost_per_byte_ms_seq);
   373               get_new_prediction(_cost_per_byte_ms_seq);
   374     } else {
   374     } else {
   375       return (double) bytes_to_copy *
   375       return (double) bytes_to_copy *
   376              get_new_prediction(_cost_per_byte_ms_during_cm_seq);
   376              get_new_prediction(_cost_per_byte_ms_during_cm_seq);
   377     }
   377     }
   378   }
   378   }
   379 
   379 
   380   double predict_object_copy_time_ms(size_t bytes_to_copy) {
   380   double predict_object_copy_time_ms(size_t bytes_to_copy) const {
   381     if (collector_state()->during_concurrent_mark()) {
   381     if (collector_state()->during_concurrent_mark()) {
   382       return predict_object_copy_time_ms_during_cm(bytes_to_copy);
   382       return predict_object_copy_time_ms_during_cm(bytes_to_copy);
   383     } else {
   383     } else {
   384       return (double) bytes_to_copy *
   384       return (double) bytes_to_copy *
   385               get_new_prediction(_cost_per_byte_ms_seq);
   385               get_new_prediction(_cost_per_byte_ms_seq);
   386     }
   386     }
   387   }
   387   }
   388 
   388 
   389   double predict_constant_other_time_ms() {
   389   double predict_constant_other_time_ms() const {
   390     return get_new_prediction(_constant_other_time_ms_seq);
   390     return get_new_prediction(_constant_other_time_ms_seq);
   391   }
   391   }
   392 
   392 
   393   double predict_young_other_time_ms(size_t young_num) {
   393   double predict_young_other_time_ms(size_t young_num) const {
   394     return (double) young_num *
   394     return (double) young_num *
   395            get_new_prediction(_young_other_cost_per_region_ms_seq);
   395            get_new_prediction(_young_other_cost_per_region_ms_seq);
   396   }
   396   }
   397 
   397 
   398   double predict_non_young_other_time_ms(size_t non_young_num) {
   398   double predict_non_young_other_time_ms(size_t non_young_num) const {
   399     return (double) non_young_num *
   399     return (double) non_young_num *
   400            get_new_prediction(_non_young_other_cost_per_region_ms_seq);
   400            get_new_prediction(_non_young_other_cost_per_region_ms_seq);
   401   }
   401   }
   402 
   402 
   403   double predict_base_elapsed_time_ms(size_t pending_cards);
   403   double predict_base_elapsed_time_ms(size_t pending_cards) const;
   404   double predict_base_elapsed_time_ms(size_t pending_cards,
   404   double predict_base_elapsed_time_ms(size_t pending_cards,
   405                                       size_t scanned_cards);
   405                                       size_t scanned_cards) const;
   406   size_t predict_bytes_to_copy(HeapRegion* hr);
   406   size_t predict_bytes_to_copy(HeapRegion* hr) const;
   407   double predict_region_elapsed_time_ms(HeapRegion* hr, bool for_young_gc);
   407   double predict_region_elapsed_time_ms(HeapRegion* hr, bool for_young_gc) const;
   408 
   408 
   409   void set_recorded_rs_lengths(size_t rs_lengths);
   409   void set_recorded_rs_lengths(size_t rs_lengths);
   410 
   410 
   411   uint cset_region_length()       { return young_cset_region_length() +
   411   uint cset_region_length() const       { return young_cset_region_length() +
   412                                            old_cset_region_length(); }
   412                                            old_cset_region_length(); }
   413   uint young_cset_region_length() { return eden_cset_region_length() +
   413   uint young_cset_region_length() const { return eden_cset_region_length() +
   414                                            survivor_cset_region_length(); }
   414                                            survivor_cset_region_length(); }
   415 
   415 
   416   double predict_survivor_regions_evac_time();
   416   double predict_survivor_regions_evac_time() const;
   417 
   417 
   418   void cset_regions_freed() {
   418   void cset_regions_freed() {
   419     bool propagate = collector_state()->should_propagate();
   419     bool propagate = collector_state()->should_propagate();
   420     _short_lived_surv_rate_group->all_surviving_words_recorded(propagate);
   420     _short_lived_surv_rate_group->all_surviving_words_recorded(propagate);
   421     _survivor_surv_rate_group->all_surviving_words_recorded(propagate);
   421     _survivor_surv_rate_group->all_surviving_words_recorded(propagate);
   424 
   424 
   425   G1MMUTracker* mmu_tracker() {
   425   G1MMUTracker* mmu_tracker() {
   426     return _mmu_tracker;
   426     return _mmu_tracker;
   427   }
   427   }
   428 
   428 
   429   double max_pause_time_ms() {
   429   const G1MMUTracker* mmu_tracker() const {
       
   430     return _mmu_tracker;
       
   431   }
       
   432 
       
   433   double max_pause_time_ms() const {
   430     return _mmu_tracker->max_gc_time() * 1000.0;
   434     return _mmu_tracker->max_gc_time() * 1000.0;
   431   }
   435   }
   432 
   436 
   433   double predict_remark_time_ms() {
   437   double predict_remark_time_ms() const {
   434     return get_new_prediction(_concurrent_mark_remark_times_ms);
   438     return get_new_prediction(_concurrent_mark_remark_times_ms);
   435   }
   439   }
   436 
   440 
   437   double predict_cleanup_time_ms() {
   441   double predict_cleanup_time_ms() const {
   438     return get_new_prediction(_concurrent_mark_cleanup_times_ms);
   442     return get_new_prediction(_concurrent_mark_cleanup_times_ms);
   439   }
   443   }
   440 
   444 
   441   // Returns an estimate of the survival rate of the region at yg-age
   445   // Returns an estimate of the survival rate of the region at yg-age
   442   // "yg_age".
   446   // "yg_age".
   443   double predict_yg_surv_rate(int age, SurvRateGroup* surv_rate_group) {
   447   double predict_yg_surv_rate(int age, SurvRateGroup* surv_rate_group) const {
   444     TruncatedSeq* seq = surv_rate_group->get_seq(age);
   448     TruncatedSeq* seq = surv_rate_group->get_seq(age);
   445     if (seq->num() == 0)
   449     if (seq->num() == 0)
   446       gclog_or_tty->print("BARF! age is %d", age);
   450       gclog_or_tty->print("BARF! age is %d", age);
   447     guarantee( seq->num() > 0, "invariant" );
   451     guarantee( seq->num() > 0, "invariant" );
   448     double pred = get_new_prediction(seq);
   452     double pred = get_new_prediction(seq);
   449     if (pred > 1.0)
   453     if (pred > 1.0)
   450       pred = 1.0;
   454       pred = 1.0;
   451     return pred;
   455     return pred;
   452   }
   456   }
   453 
   457 
   454   double predict_yg_surv_rate(int age) {
   458   double predict_yg_surv_rate(int age) const {
   455     return predict_yg_surv_rate(age, _short_lived_surv_rate_group);
   459     return predict_yg_surv_rate(age, _short_lived_surv_rate_group);
   456   }
   460   }
   457 
   461 
   458   double accum_yg_surv_rate_pred(int age) {
   462   double accum_yg_surv_rate_pred(int age) const {
   459     return _short_lived_surv_rate_group->accum_surv_rate_pred(age);
   463     return _short_lived_surv_rate_group->accum_surv_rate_pred(age);
   460   }
   464   }
   461 
   465 
   462 private:
   466 private:
   463   // Statistics kept per GC stoppage, pause or full.
   467   // Statistics kept per GC stoppage, pause or full.
   534   G1GCPhaseTimes* _phase_times;
   538   G1GCPhaseTimes* _phase_times;
   535 
   539 
   536   // The ratio of gc time to elapsed time, computed over recent pauses.
   540   // The ratio of gc time to elapsed time, computed over recent pauses.
   537   double _recent_avg_pause_time_ratio;
   541   double _recent_avg_pause_time_ratio;
   538 
   542 
   539   double recent_avg_pause_time_ratio() {
   543   double recent_avg_pause_time_ratio() const {
   540     return _recent_avg_pause_time_ratio;
   544     return _recent_avg_pause_time_ratio;
   541   }
   545   }
   542 
   546 
   543   // This set of variables tracks the collector efficiency, in order to
   547   // This set of variables tracks the collector efficiency, in order to
   544   // determine whether we should initiate a new marking.
   548   // determine whether we should initiate a new marking.
   554   void update_young_list_target_length(size_t rs_lengths = (size_t) -1);
   558   void update_young_list_target_length(size_t rs_lengths = (size_t) -1);
   555 
   559 
   556   // Calculate and return the minimum desired young list target
   560   // Calculate and return the minimum desired young list target
   557   // length. This is the minimum desired young list length according
   561   // length. This is the minimum desired young list length according
   558   // to the user's inputs.
   562   // to the user's inputs.
   559   uint calculate_young_list_desired_min_length(uint base_min_length);
   563   uint calculate_young_list_desired_min_length(uint base_min_length) const;
   560 
   564 
   561   // Calculate and return the maximum desired young list target
   565   // Calculate and return the maximum desired young list target
   562   // length. This is the maximum desired young list length according
   566   // length. This is the maximum desired young list length according
   563   // to the user's inputs.
   567   // to the user's inputs.
   564   uint calculate_young_list_desired_max_length();
   568   uint calculate_young_list_desired_max_length() const;
   565 
   569 
   566   // Calculate and return the maximum young list target length that
   570   // Calculate and return the maximum young list target length that
   567   // can fit into the pause time goal. The parameters are: rs_lengths
   571   // can fit into the pause time goal. The parameters are: rs_lengths
   568   // represent the prediction of how large the young RSet lengths will
   572   // represent the prediction of how large the young RSet lengths will
   569   // be, base_min_length is the already existing number of regions in
   573   // be, base_min_length is the already existing number of regions in
   570   // the young list, min_length and max_length are the desired min and
   574   // the young list, min_length and max_length are the desired min and
   571   // max young list length according to the user's inputs.
   575   // max young list length according to the user's inputs.
   572   uint calculate_young_list_target_length(size_t rs_lengths,
   576   uint calculate_young_list_target_length(size_t rs_lengths,
   573                                           uint base_min_length,
   577                                           uint base_min_length,
   574                                           uint desired_min_length,
   578                                           uint desired_min_length,
   575                                           uint desired_max_length);
   579                                           uint desired_max_length) const;
   576 
   580 
   577   // Calculate and return chunk size (in number of regions) for parallel
   581   // Calculate and return chunk size (in number of regions) for parallel
   578   // concurrent mark cleanup.
   582   // concurrent mark cleanup.
   579   uint calculate_parallel_work_chunk_size(uint n_workers, uint n_regions);
   583   uint calculate_parallel_work_chunk_size(uint n_workers, uint n_regions) const;
   580 
   584 
   581   // Check whether a given young length (young_length) fits into the
   585   // Check whether a given young length (young_length) fits into the
   582   // given target pause time and whether the prediction for the amount
   586   // given target pause time and whether the prediction for the amount
   583   // of objects to be copied for the given length will fit into the
   587   // of objects to be copied for the given length will fit into the
   584   // given free space (expressed by base_free_regions).  It is used by
   588   // given free space (expressed by base_free_regions).  It is used by
   585   // calculate_young_list_target_length().
   589   // calculate_young_list_target_length().
   586   bool predict_will_fit(uint young_length, double base_time_ms,
   590   bool predict_will_fit(uint young_length, double base_time_ms,
   587                         uint base_free_regions, double target_pause_time_ms);
   591                         uint base_free_regions, double target_pause_time_ms) const;
   588 
   592 
   589   // Calculate the minimum number of old regions we'll add to the CSet
   593   // Calculate the minimum number of old regions we'll add to the CSet
   590   // during a mixed GC.
   594   // during a mixed GC.
   591   uint calc_min_old_cset_length();
   595   uint calc_min_old_cset_length() const;
   592 
   596 
   593   // Calculate the maximum number of old regions we'll add to the CSet
   597   // Calculate the maximum number of old regions we'll add to the CSet
   594   // during a mixed GC.
   598   // during a mixed GC.
   595   uint calc_max_old_cset_length();
   599   uint calc_max_old_cset_length() const;
   596 
   600 
   597   // Returns the given amount of uncollected reclaimable space
   601   // Returns the given amount of uncollected reclaimable space
   598   // as a percentage of the current heap capacity.
   602   // as a percentage of the current heap capacity.
   599   double reclaimable_bytes_perc(size_t reclaimable_bytes);
   603   double reclaimable_bytes_perc(size_t reclaimable_bytes) const;
   600 
   604 
   601 public:
   605 public:
   602 
   606 
   603   G1CollectorPolicy();
   607   G1CollectorPolicy();
   604 
   608 
   605   virtual G1CollectorPolicy* as_g1_policy() { return this; }
   609   virtual G1CollectorPolicy* as_g1_policy() { return this; }
   606 
   610 
       
   611   const G1CollectorState* collector_state() const;
   607   G1CollectorState* collector_state();
   612   G1CollectorState* collector_state();
   608 
   613 
   609   G1GCPhaseTimes* phase_times() const { return _phase_times; }
   614   G1GCPhaseTimes* phase_times() const { return _phase_times; }
   610 
   615 
   611   // Check the current value of the young list RSet lengths and
   616   // Check the current value of the young list RSet lengths and
   656   // print_detailed_heap_transition
   661   // print_detailed_heap_transition
   657   void record_heap_size_info_at_start(bool full);
   662   void record_heap_size_info_at_start(bool full);
   658 
   663 
   659   // Print heap sizing transition (with less and more detail).
   664   // Print heap sizing transition (with less and more detail).
   660 
   665 
   661   void print_heap_transition(size_t bytes_before);
   666   void print_heap_transition(size_t bytes_before) const;
   662   void print_heap_transition();
   667   void print_heap_transition() const;
   663   void print_detailed_heap_transition(bool full = false);
   668   void print_detailed_heap_transition(bool full = false) const;
   664 
   669 
   665   void record_stop_world_start();
   670   void record_stop_world_start();
   666   void record_concurrent_pause();
   671   void record_concurrent_pause();
   667 
   672 
   668   // Record how much space we copied during a GC. This is typically
   673   // Record how much space we copied during a GC. This is typically
   670   void record_bytes_copied_during_gc(size_t bytes) {
   675   void record_bytes_copied_during_gc(size_t bytes) {
   671     _bytes_copied_during_gc += bytes;
   676     _bytes_copied_during_gc += bytes;
   672   }
   677   }
   673 
   678 
   674   // The amount of space we copied during a GC.
   679   // The amount of space we copied during a GC.
   675   size_t bytes_copied_during_gc() {
   680   size_t bytes_copied_during_gc() const {
   676     return _bytes_copied_during_gc;
   681     return _bytes_copied_during_gc;
   677   }
   682   }
   678 
   683 
   679   size_t collection_set_bytes_used_before() const {
   684   size_t collection_set_bytes_used_before() const {
   680     return _collection_set_bytes_used_before;
   685     return _collection_set_bytes_used_before;
   682 
   687 
   683   // Determine whether there are candidate regions so that the
   688   // Determine whether there are candidate regions so that the
   684   // next GC should be mixed. The two action strings are used
   689   // next GC should be mixed. The two action strings are used
   685   // in the ergo output when the method returns true or false.
   690   // in the ergo output when the method returns true or false.
   686   bool next_gc_should_be_mixed(const char* true_action_str,
   691   bool next_gc_should_be_mixed(const char* true_action_str,
   687                                const char* false_action_str);
   692                                const char* false_action_str) const;
   688 
   693 
   689   // Choose a new collection set.  Marks the chosen regions as being
   694   // Choose a new collection set.  Marks the chosen regions as being
   690   // "in_collection_set", and links them together.  The head and number of
   695   // "in_collection_set", and links them together.  The head and number of
   691   // the collection set are available via access methods.
   696   // the collection set are available via access methods.
   692   double finalize_young_cset_part(double target_pause_time_ms);
   697   double finalize_young_cset_part(double target_pause_time_ms);
   762   // the initial-mark work and start a marking cycle.
   767   // the initial-mark work and start a marking cycle.
   763   void decide_on_conc_mark_initiation();
   768   void decide_on_conc_mark_initiation();
   764 
   769 
   765   // If an expansion would be appropriate, because recent GC overhead had
   770   // If an expansion would be appropriate, because recent GC overhead had
   766   // exceeded the desired limit, return an amount to expand by.
   771   // exceeded the desired limit, return an amount to expand by.
   767   virtual size_t expansion_amount();
   772   virtual size_t expansion_amount() const;
   768 
   773 
   769   // Print tracing information.
   774   // Print tracing information.
   770   void print_tracing_info() const;
   775   void print_tracing_info() const;
   771 
   776 
   772   // Print stats on young survival ratio
   777   // Print stats on young survival ratio
   781     // do that for any other surv rate groups
   786     // do that for any other surv rate groups
   782   }
   787   }
   783 
   788 
   784   size_t young_list_target_length() const { return _young_list_target_length; }
   789   size_t young_list_target_length() const { return _young_list_target_length; }
   785 
   790 
   786   bool is_young_list_full();
   791   bool is_young_list_full() const;
   787 
   792 
   788   bool can_expand_young_list();
   793   bool can_expand_young_list() const;
   789 
   794 
   790   uint young_list_max_length() {
   795   uint young_list_max_length() const {
   791     return _young_list_max_length;
   796     return _young_list_max_length;
   792   }
   797   }
   793 
   798 
   794   bool adaptive_young_list_length() {
   799   bool adaptive_young_list_length() const {
   795     return _young_gen_sizer->adaptive_young_list_length();
   800     return _young_gen_sizer->adaptive_young_list_length();
   796   }
   801   }
   797 
   802 
   798 private:
   803 private:
   799   //
   804   //
   830 public:
   835 public:
   831   uint tenuring_threshold() const { return _tenuring_threshold; }
   836   uint tenuring_threshold() const { return _tenuring_threshold; }
   832 
   837 
   833   static const uint REGIONS_UNLIMITED = (uint) -1;
   838   static const uint REGIONS_UNLIMITED = (uint) -1;
   834 
   839 
   835   uint max_regions(InCSetState dest) {
   840   uint max_regions(InCSetState dest) const {
   836     switch (dest.value()) {
   841     switch (dest.value()) {
   837       case InCSetState::Young:
   842       case InCSetState::Young:
   838         return _max_survivor_regions;
   843         return _max_survivor_regions;
   839       case InCSetState::Old:
   844       case InCSetState::Old:
   840         return REGIONS_UNLIMITED;
   845         return REGIONS_UNLIMITED;
   860     _recorded_survivor_regions = regions;
   865     _recorded_survivor_regions = regions;
   861     _recorded_survivor_head    = head;
   866     _recorded_survivor_head    = head;
   862     _recorded_survivor_tail    = tail;
   867     _recorded_survivor_tail    = tail;
   863   }
   868   }
   864 
   869 
   865   uint recorded_survivor_regions() {
   870   uint recorded_survivor_regions() const {
   866     return _recorded_survivor_regions;
   871     return _recorded_survivor_regions;
   867   }
   872   }
   868 
   873 
   869   void record_age_table(ageTable* age_table) {
   874   void record_age_table(ageTable* age_table) {
   870     _survivors_age_table.merge(age_table);
   875     _survivors_age_table.merge(age_table);