48 class G1YoungGenSizer; |
48 class G1YoungGenSizer; |
49 class GCPolicyCounters; |
49 class GCPolicyCounters; |
50 |
50 |
51 class G1Policy: public CHeapObj<mtGC> { |
51 class G1Policy: public CHeapObj<mtGC> { |
52 private: |
52 private: |
53 G1IHOPControl* _ihop_control; |
53 |
54 |
54 static G1IHOPControl* create_ihop_control(const G1Predictions* predictor); |
55 G1IHOPControl* create_ihop_control() const; |
|
56 // Update the IHOP control with necessary statistics. |
55 // Update the IHOP control with necessary statistics. |
57 void update_ihop_prediction(double mutator_time_s, |
56 void update_ihop_prediction(double mutator_time_s, |
58 size_t mutator_alloc_bytes, |
57 size_t mutator_alloc_bytes, |
59 size_t young_gen_size); |
58 size_t young_gen_size); |
60 void report_ihop_statistics(); |
59 void report_ihop_statistics(); |
61 |
60 |
62 G1Predictions _predictor; |
61 G1Predictions _predictor; |
63 G1Analytics* _analytics; |
62 G1Analytics* _analytics; |
64 G1MMUTracker* _mmu_tracker; |
63 G1MMUTracker* _mmu_tracker; |
|
64 G1IHOPControl* _ihop_control; |
65 |
65 |
66 GCPolicyCounters* _policy_counters; |
66 GCPolicyCounters* _policy_counters; |
67 |
67 |
68 double _full_collection_start_sec; |
68 double _full_collection_start_sec; |
69 |
69 |
72 |
72 |
73 // The max number of regions we can extend the eden by while the GC |
73 // The max number of regions we can extend the eden by while the GC |
74 // locker is active. This should be >= _young_list_target_length; |
74 // locker is active. This should be >= _young_list_target_length; |
75 uint _young_list_max_length; |
75 uint _young_list_max_length; |
76 |
76 |
|
77 // SurvRateGroups below must be initialized after the predictor because they |
|
78 // indirectly use it through this object passed to their constructor. |
77 SurvRateGroup* _short_lived_surv_rate_group; |
79 SurvRateGroup* _short_lived_surv_rate_group; |
78 SurvRateGroup* _survivor_surv_rate_group; |
80 SurvRateGroup* _survivor_surv_rate_group; |
79 |
81 |
80 double _reserve_factor; |
82 double _reserve_factor; |
|
83 // This will be set when the heap is expanded |
|
84 // for the first time during initialization. |
81 uint _reserve_regions; |
85 uint _reserve_regions; |
82 |
86 |
83 G1YoungGenSizer _young_gen_sizer; |
87 G1YoungGenSizer _young_gen_sizer; |
84 |
88 |
85 uint _free_regions_at_end_of_collection; |
89 uint _free_regions_at_end_of_collection; |
89 size_t _rs_lengths_prediction; |
93 size_t _rs_lengths_prediction; |
90 |
94 |
91 #ifndef PRODUCT |
95 #ifndef PRODUCT |
92 bool verify_young_ages(HeapRegion* head, SurvRateGroup *surv_rate_group); |
96 bool verify_young_ages(HeapRegion* head, SurvRateGroup *surv_rate_group); |
93 #endif // PRODUCT |
97 #endif // PRODUCT |
94 |
|
95 double _pause_time_target_ms; |
|
96 |
98 |
97 size_t _pending_cards; |
99 size_t _pending_cards; |
98 |
100 |
99 // The amount of allocated bytes in old gen during the last mutator and the following |
101 // The amount of allocated bytes in old gen during the last mutator and the following |
100 // young GC phase. |
102 // young GC phase. |
297 void revise_young_list_target_length_if_necessary(size_t rs_lengths); |
299 void revise_young_list_target_length_if_necessary(size_t rs_lengths); |
298 |
300 |
299 // This should be called after the heap is resized. |
301 // This should be called after the heap is resized. |
300 void record_new_heap_size(uint new_number_of_regions); |
302 void record_new_heap_size(uint new_number_of_regions); |
301 |
303 |
302 void init(); |
304 void init(G1CollectedHeap* g1h, G1CollectionSet* collection_set); |
303 |
305 |
304 virtual void note_gc_start(); |
306 virtual void note_gc_start(); |
305 |
307 |
306 bool need_to_start_conc_mark(const char* source, size_t alloc_word_size = 0); |
308 bool need_to_start_conc_mark(const char* source, size_t alloc_word_size = 0); |
307 |
309 |