57 private:
58
59 static G1IHOPControl* create_ihop_control(const G1Predictions* predictor);
60 // Update the IHOP control with necessary statistics.
61 void update_ihop_prediction(double mutator_time_s,
62 size_t mutator_alloc_bytes,
63 size_t young_gen_size,
64 bool this_gc_was_young_only);
65 void report_ihop_statistics();
66
67 G1Predictions _predictor;
68 G1Analytics* _analytics;
69 G1RemSetTrackingPolicy _remset_tracker;
70 G1MMUTracker* _mmu_tracker;
71 G1IHOPControl* _ihop_control;
72
73 GCPolicyCounters* _policy_counters;
74
75 double _full_collection_start_sec;
76
77 jlong _collection_pause_end_millis;
78
79 uint _young_list_target_length;
80 uint _young_list_fixed_length;
81
82 // The max number of regions we can extend the eden by while the GC
83 // locker is active. This should be >= _young_list_target_length;
84 uint _young_list_max_length;
85
86 // The survivor rate groups below must be initialized after the predictor because they
87 // indirectly use it through the "this" object passed to their constructor.
88 G1SurvRateGroup* _eden_surv_rate_group;
89 G1SurvRateGroup* _survivor_surv_rate_group;
90
91 double _reserve_factor;
92 // This will be set when the heap is expanded
93 // for the first time during initialization.
94 uint _reserve_regions;
95
96 G1YoungGenSizer* _young_gen_sizer;
97
98 uint _free_regions_at_end_of_collection;
242 // given free space (expressed by base_free_regions). It is used by
243 // calculate_young_list_target_length().
244 bool predict_will_fit(uint young_length, double base_time_ms,
245 uint base_free_regions, double target_pause_time_ms) const;
246
247 public:
248 size_t pending_cards_at_gc_start() const { return _pending_cards_at_gc_start; }
249
250 // Calculate the minimum number of old regions we'll add to the CSet
251 // during a mixed GC.
252 uint calc_min_old_cset_length() const;
253
254 // Calculate the maximum number of old regions we'll add to the CSet
255 // during a mixed GC.
256 uint calc_max_old_cset_length() const;
257
258 // Returns the given amount of reclaimable bytes (that represents
259 // the amount of reclaimable space still to be collected) as a
260 // percentage of the current heap capacity.
261 double reclaimable_bytes_percent(size_t reclaimable_bytes) const;
262
263 jlong collection_pause_end_millis() { return _collection_pause_end_millis; }
264
265 private:
266 void clear_collection_set_candidates();
267 // Sets up marking if proper conditions are met.
268 void maybe_start_marking();
269
270 // The kind of STW pause.
271 enum PauseKind {
272 FullGC,
273 YoungOnlyGC,
274 MixedGC,
275 LastYoungGC,
276 ConcurrentStartGC,
277 Cleanup,
278 Remark
279 };
280
281 static bool is_young_only_pause(PauseKind kind);
282 static bool is_mixed_pause(PauseKind kind);
283 static bool is_last_young_pause(PauseKind kind);
|
57 private:
58
59 static G1IHOPControl* create_ihop_control(const G1Predictions* predictor);
60 // Update the IHOP control with necessary statistics.
61 void update_ihop_prediction(double mutator_time_s,
62 size_t mutator_alloc_bytes,
63 size_t young_gen_size,
64 bool this_gc_was_young_only);
65 void report_ihop_statistics();
66
67 G1Predictions _predictor;
68 G1Analytics* _analytics;
69 G1RemSetTrackingPolicy _remset_tracker;
70 G1MMUTracker* _mmu_tracker;
71 G1IHOPControl* _ihop_control;
72
73 GCPolicyCounters* _policy_counters;
74
75 double _full_collection_start_sec;
76
77 uint _young_list_target_length;
78 uint _young_list_fixed_length;
79
80 // The max number of regions we can extend the eden by while the GC
81 // locker is active. This should be >= _young_list_target_length;
82 uint _young_list_max_length;
83
84 // The survivor rate groups below must be initialized after the predictor because they
85 // indirectly use it through the "this" object passed to their constructor.
86 G1SurvRateGroup* _eden_surv_rate_group;
87 G1SurvRateGroup* _survivor_surv_rate_group;
88
89 double _reserve_factor;
90 // This will be set when the heap is expanded
91 // for the first time during initialization.
92 uint _reserve_regions;
93
94 G1YoungGenSizer* _young_gen_sizer;
95
96 uint _free_regions_at_end_of_collection;
240 // given free space (expressed by base_free_regions). It is used by
241 // calculate_young_list_target_length().
242 bool predict_will_fit(uint young_length, double base_time_ms,
243 uint base_free_regions, double target_pause_time_ms) const;
244
245 public:
246 size_t pending_cards_at_gc_start() const { return _pending_cards_at_gc_start; }
247
248 // Calculate the minimum number of old regions we'll add to the CSet
249 // during a mixed GC.
250 uint calc_min_old_cset_length() const;
251
252 // Calculate the maximum number of old regions we'll add to the CSet
253 // during a mixed GC.
254 uint calc_max_old_cset_length() const;
255
256 // Returns the given amount of reclaimable bytes (that represents
257 // the amount of reclaimable space still to be collected) as a
258 // percentage of the current heap capacity.
259 double reclaimable_bytes_percent(size_t reclaimable_bytes) const;
260
261 private:
262 void clear_collection_set_candidates();
263 // Sets up marking if proper conditions are met.
264 void maybe_start_marking();
265
266 // The kind of STW pause.
267 enum PauseKind {
268 FullGC,
269 YoungOnlyGC,
270 MixedGC,
271 LastYoungGC,
272 ConcurrentStartGC,
273 Cleanup,
274 Remark
275 };
276
277 static bool is_young_only_pause(PauseKind kind);
278 static bool is_mixed_pause(PauseKind kind);
279 static bool is_last_young_pause(PauseKind kind);
|