8294842: Pass actual pending cards to G1Policy::update_young_length_bounds during young gen revise
Reviewed-by: kbarrett, ayang
This commit is contained in:
parent
7133fc93e1
commit
f31c80d951
@ -140,8 +140,8 @@ public:
|
||||
double predict_concurrent_refine_rate_ms() const;
|
||||
double predict_dirtied_cards_rate_ms() const;
|
||||
|
||||
// Predict how many cards in a remembered set of length rs_length will need to
|
||||
// be scanned in addition to the pending log buffer cards.
|
||||
// Predict how many of the given remembered set of length rs_length will add to
|
||||
// the number of total cards scanned.
|
||||
size_t predict_scan_card_num(size_t rs_length, bool for_young_gc) const;
|
||||
|
||||
double predict_card_merge_time_ms(size_t card_num, bool for_young_gc) const;
|
||||
|
@ -194,11 +194,12 @@ uint G1Policy::calculate_desired_eden_length_by_mmu() const {
|
||||
}
|
||||
|
||||
void G1Policy::update_young_length_bounds() {
|
||||
update_young_length_bounds(_analytics->predict_rs_length());
|
||||
update_young_length_bounds(_analytics->predict_pending_cards(),
|
||||
_analytics->predict_rs_length());
|
||||
}
|
||||
|
||||
void G1Policy::update_young_length_bounds(size_t rs_length) {
|
||||
_young_list_desired_length = calculate_young_desired_length(rs_length);
|
||||
void G1Policy::update_young_length_bounds(size_t pending_cards, size_t rs_length) {
|
||||
_young_list_desired_length = calculate_young_desired_length(pending_cards, rs_length);
|
||||
_young_list_target_length = calculate_young_target_length(_young_list_desired_length);
|
||||
_young_list_max_length = calculate_young_max_length(_young_list_target_length);
|
||||
|
||||
@ -221,7 +222,7 @@ void G1Policy::update_young_length_bounds(size_t rs_length) {
|
||||
// The main reason is revising young length, with or without the GCLocker being
|
||||
// active.
|
||||
//
|
||||
uint G1Policy::calculate_young_desired_length(size_t rs_length) const {
|
||||
uint G1Policy::calculate_young_desired_length(size_t pending_cards, size_t rs_length) const {
|
||||
uint min_young_length_by_sizer = _young_gen_sizer.min_desired_young_length();
|
||||
uint max_young_length_by_sizer = _young_gen_sizer.max_desired_young_length();
|
||||
|
||||
@ -256,7 +257,6 @@ uint G1Policy::calculate_young_desired_length(size_t rs_length) const {
|
||||
if (use_adaptive_young_list_length()) {
|
||||
desired_eden_length_by_mmu = calculate_desired_eden_length_by_mmu();
|
||||
|
||||
const size_t pending_cards = _analytics->predict_pending_cards();
|
||||
double base_time_ms = predict_base_time_ms(pending_cards, rs_length);
|
||||
|
||||
desired_eden_length_by_pause =
|
||||
@ -523,7 +523,11 @@ void G1Policy::revise_young_list_target_length_if_necessary(size_t rs_length) {
|
||||
// add 10% to avoid having to recalculate often
|
||||
size_t rs_length_prediction = rs_length * 1100 / 1000;
|
||||
update_rs_length_prediction(rs_length_prediction);
|
||||
update_young_length_bounds(rs_length_prediction);
|
||||
|
||||
G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
|
||||
// We have no measure of the number of cards in the thread log buffers, assume
|
||||
// these are very few compared to the sum of the two other sources.
|
||||
update_young_length_bounds(dcqs.num_cards(), rs_length_prediction);
|
||||
}
|
||||
}
|
||||
|
||||
@ -914,7 +918,7 @@ void G1Policy::record_young_collection_end(bool concurrent_operation_is_full_mar
|
||||
} else {
|
||||
// Any garbage collection triggered as periodic collection resets the time-to-mixed
|
||||
// measurement. Periodic collection typically means that the application is "inactive", i.e.
|
||||
// the marking threads may have received an uncharacterisic amount of cpu time
|
||||
// the marking threads may have received an uncharacteristic amount of cpu time
|
||||
// for completing the marking, i.e. are faster than expected.
|
||||
// This skews the predicted marking length towards smaller values which might cause
|
||||
// the mark start being too late.
|
||||
|
@ -194,10 +194,10 @@ private:
|
||||
double _mark_cleanup_start_sec;
|
||||
|
||||
// Updates the internal young gen maximum and target and desired lengths.
|
||||
// If no rs_length parameter is passed, predict the RS length using the
|
||||
// prediction model, otherwise use the given rs_length as the prediction.
|
||||
// If no parameters are passed, predict pending cards and the RS length using
|
||||
// the prediction model.
|
||||
void update_young_length_bounds();
|
||||
void update_young_length_bounds(size_t rs_length);
|
||||
void update_young_length_bounds(size_t pending_cards, size_t rs_length);
|
||||
|
||||
// Calculate and return the minimum desired eden length based on the MMU target.
|
||||
uint calculate_desired_eden_length_by_mmu() const;
|
||||
@ -225,7 +225,7 @@ private:
|
||||
|
||||
// Calculate desired young length based on current situation without taking actually
|
||||
// available free regions into account.
|
||||
uint calculate_young_desired_length(size_t rs_length) const;
|
||||
uint calculate_young_desired_length(size_t pending_cards, size_t rs_length) const;
|
||||
// Limit the given desired young length to available free regions.
|
||||
uint calculate_young_target_length(uint desired_young_length) const;
|
||||
// The GCLocker might cause us to need more regions than the target. Calculate
|
||||
|
Loading…
x
Reference in New Issue
Block a user