719 size_t rs_lengths = _g1->young_list()->sampled_rs_lengths(); 720 if (rs_lengths > _rs_lengths_prediction) { 721 // add 10% to avoid having to recalculate often 722 size_t rs_lengths_prediction = rs_lengths * 1100 / 1000; 723 update_rs_lengths_prediction(rs_lengths_prediction); 724 725 update_young_list_max_and_target_length(rs_lengths_prediction); 726 } 727 } 728 729 void G1CollectorPolicy::update_rs_lengths_prediction() { 730 update_rs_lengths_prediction(get_new_size_prediction(_rs_lengths_seq)); 731 } 732 733 void G1CollectorPolicy::update_rs_lengths_prediction(size_t prediction) { 734 if (collector_state()->gcs_are_young() && adaptive_young_list_length()) { 735 _rs_lengths_prediction = prediction; 736 } 737 } 738 739 HeapWord* G1CollectorPolicy::mem_allocate_work(size_t size, 740 bool is_tlab, 741 bool* gc_overhead_limit_was_exceeded) { 742 guarantee(false, "Not using this policy feature yet."); 743 return NULL; 744 } 745 746 // This method controls how a collector handles one or more 747 // of its generations being fully allocated. 748 HeapWord* G1CollectorPolicy::satisfy_failed_allocation(size_t size, 749 bool is_tlab) { 750 guarantee(false, "Not using this policy feature yet."); 751 return NULL; 752 } 753 754 755 #ifndef PRODUCT 756 bool G1CollectorPolicy::verify_young_ages() { 757 HeapRegion* head = _g1->young_list()->first_region(); 758 return 759 verify_young_ages(head, _short_lived_surv_rate_group); 760 // also call verify_young_ages on any additional surv rate groups 761 } 762 763 bool 764 G1CollectorPolicy::verify_young_ages(HeapRegion* head, 765 SurvRateGroup *surv_rate_group) { 766 guarantee( surv_rate_group != NULL, "pre-condition" ); 767 768 const char* name = surv_rate_group->name(); 769 bool ret = true; 770 int prev_age = -1; 771 772 for (HeapRegion* curr = head; 773 curr != NULL; 774 curr = curr->get_next_young_region()) { | 719 size_t rs_lengths = _g1->young_list()->sampled_rs_lengths(); 720 if (rs_lengths > _rs_lengths_prediction) { 721 // add 10% to avoid having to recalculate often 722 size_t rs_lengths_prediction = rs_lengths * 1100 / 1000; 723 update_rs_lengths_prediction(rs_lengths_prediction); 724 725 update_young_list_max_and_target_length(rs_lengths_prediction); 726 } 727 } 728 729 void G1CollectorPolicy::update_rs_lengths_prediction() { 730 update_rs_lengths_prediction(get_new_size_prediction(_rs_lengths_seq)); 731 } 732 733 void G1CollectorPolicy::update_rs_lengths_prediction(size_t prediction) { 734 if (collector_state()->gcs_are_young() && adaptive_young_list_length()) { 735 _rs_lengths_prediction = prediction; 736 } 737 } 738 739 #ifndef PRODUCT 740 bool G1CollectorPolicy::verify_young_ages() { 741 HeapRegion* head = _g1->young_list()->first_region(); 742 return 743 verify_young_ages(head, _short_lived_surv_rate_group); 744 // also call verify_young_ages on any additional surv rate groups 745 } 746 747 bool 748 G1CollectorPolicy::verify_young_ages(HeapRegion* head, 749 SurvRateGroup *surv_rate_group) { 750 guarantee( surv_rate_group != NULL, "pre-condition" ); 751 752 const char* name = surv_rate_group->name(); 753 bool ret = true; 754 int prev_age = -1; 755 756 for (HeapRegion* curr = head; 757 curr != NULL; 758 curr = curr->get_next_young_region()) { |