src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp
Print this page
rev 3486 : 7185699: G1: Prediction model discrepancies
Summary: Correct the result value of G1CollectedHeap::pending_card_num(). Change the code that calculates the GC efficiency of a non-young heap region to use historical data from mixed GCs and the actual number of live bytes when predicting how long it would take to collect the region.
Reviewed-by:
*** 493,508 ****
double accum_yg_surv_rate_pred(int age) {
return _short_lived_surv_rate_group->accum_surv_rate_pred(age);
}
private:
- size_t _bytes_in_collection_set_before_gc;
- size_t _bytes_copied_during_gc;
-
- // Used to count used bytes in CS.
- friend class CountCSClosure;
-
// Statistics kept per GC stoppage, pause or full.
TruncatedSeq* _recent_prev_end_times_for_all_gcs_sec;
// Add a new GC of the given duration and end time to the record.
void update_recent_gc_times(double end_time_sec, double elapsed_ms);
--- 493,502 ----
*** 512,524 ****
// set at the start of the pause.
HeapRegion* _collection_set;
// The number of bytes in the collection set before the pause. Set from
// the incrementally built collection set at the start of an evacuation
! // pause.
size_t _collection_set_bytes_used_before;
// The associated information that is maintained while the incremental
// collection set is being built with young regions. Used to populate
// the recorded info for the evacuation pause.
enum CSetBuildType {
--- 506,522 ----
// set at the start of the pause.
HeapRegion* _collection_set;
// The number of bytes in the collection set before the pause. Set from
// the incrementally built collection set at the start of an evacuation
! // pause, and incremented in finalize_cset() when adding old regions
! // (if any) to the collection set.
size_t _collection_set_bytes_used_before;
+ // The number of bytes copied during the GC.
+ size_t _bytes_copied_during_gc;
+
// The associated information that is maintained while the incremental
// collection set is being built with young regions. Used to populate
// the recorded info for the evacuation pause.
enum CSetBuildType {
*** 644,656 ****
// given free space (expressed by base_free_regions). It is used by
// calculate_young_list_target_length().
bool predict_will_fit(uint young_length, double base_time_ms,
uint base_free_regions, double target_pause_time_ms);
- // Count the number of bytes used in the CS.
- void count_CS_bytes_used();
-
public:
G1CollectorPolicy();
virtual G1CollectorPolicy* as_g1_policy() { return this; }
--- 642,651 ----
*** 664,677 ****
// Check the current value of the young list RSet lengths and
// compare it against the last prediction. If the current value is
// higher, recalculate the young list target length prediction.
void revise_young_list_target_length_if_necessary();
- size_t bytes_in_collection_set() {
- return _bytes_in_collection_set_before_gc;
- }
-
// This should be called after the heap is resized.
void record_new_heap_size(uint new_number_of_regions);
void init();
--- 659,668 ----