967 if (!this_gc_was_young_only && _initial_mark_to_mixed.has_result()) {
968 marking_to_mixed_time = _initial_mark_to_mixed.last_marking_time();
969 assert(marking_to_mixed_time > 0.0,
970 "Initial mark to mixed time must be larger than zero but is %.3f",
971 marking_to_mixed_time);
972 if (marking_to_mixed_time > min_valid_time) {
973 _ihop_control->update_marking_length(marking_to_mixed_time);
974 report = true;
975 }
976 }
977
978 // As an approximation for the young gc promotion rates during marking we use
979 // all of them. In many applications there are only a few if any young gcs during
980 // marking, which makes any prediction useless. This increases the accuracy of the
981 // prediction.
982 if (this_gc_was_young_only && mutator_time_s > min_valid_time) {
983 // IHOP control wants to know the expected young gen length if it were not
984 // restrained by the heap reserve. Using the actual length would make the
985 // prediction too small and the limit the young gen every time we get to the
986 // predicted target occupancy.
987 uint young_gen_size = young_list_desired_length() * HeapRegion::GrainBytes;
988 _ihop_control->update_allocation_info(mutator_time_s, mutator_alloc_bytes, young_gen_size);
989 report = true;
990 }
991
992 if (report) {
993 report_ihop_statistics();
994 }
995 }
996
997 void G1Policy::report_ihop_statistics() {
998 _ihop_control->print();
999 }
1000
1001 void G1Policy::print_phases() {
1002 phase_times()->print();
1003 }
1004
1005 double G1Policy::predict_base_elapsed_time_ms(size_t pending_cards,
1006 size_t rs_length) const {
1007 size_t effective_scanned_cards = _analytics->predict_scan_card_num(rs_length, collector_state()->in_young_only_phase());
|
967 if (!this_gc_was_young_only && _initial_mark_to_mixed.has_result()) {
968 marking_to_mixed_time = _initial_mark_to_mixed.last_marking_time();
969 assert(marking_to_mixed_time > 0.0,
970 "Initial mark to mixed time must be larger than zero but is %.3f",
971 marking_to_mixed_time);
972 if (marking_to_mixed_time > min_valid_time) {
973 _ihop_control->update_marking_length(marking_to_mixed_time);
974 report = true;
975 }
976 }
977
978 // As an approximation for the young gc promotion rates during marking we use
979 // all of them. In many applications there are only a few if any young gcs during
980 // marking, which makes any prediction useless. This increases the accuracy of the
981 // prediction.
982 if (this_gc_was_young_only && mutator_time_s > min_valid_time) {
983 // IHOP control wants to know the expected young gen length if it were not
984 // restrained by the heap reserve. Using the actual length would make the
985 // prediction too small and the limit the young gen every time we get to the
986 // predicted target occupancy.
987 size_t young_gen_size = young_list_desired_length() * HeapRegion::GrainBytes;
988 _ihop_control->update_allocation_info(mutator_time_s, mutator_alloc_bytes, young_gen_size);
989 report = true;
990 }
991
992 if (report) {
993 report_ihop_statistics();
994 }
995 }
996
997 void G1Policy::report_ihop_statistics() {
998 _ihop_control->print();
999 }
1000
1001 void G1Policy::print_phases() {
1002 phase_times()->print();
1003 }
1004
1005 double G1Policy::predict_base_elapsed_time_ms(size_t pending_cards,
1006 size_t rs_length) const {
1007 size_t effective_scanned_cards = _analytics->predict_scan_card_num(rs_length, collector_state()->in_young_only_phase());
|