484 _mark_cleanup_start_sec = os::elapsedTime();
485 }
486
487 void G1DefaultPolicy::record_concurrent_mark_cleanup_completed() {
488 bool should_continue_with_reclaim = next_gc_should_be_mixed("request last young-only gc",
489 "skip last young-only gc");
490 collector_state()->set_last_young_gc(should_continue_with_reclaim);
491 // We skip the marking phase.
492 if (!should_continue_with_reclaim) {
493 abort_time_to_mixed_tracking();
494 }
495 collector_state()->set_in_marking_window(false);
496 }
497
498 double G1DefaultPolicy::average_time_ms(G1GCPhaseTimes::GCParPhases phase) const {
499 return phase_times()->average_time_ms(phase);
500 }
501
502 double G1DefaultPolicy::young_other_time_ms() const {
503 return phase_times()->young_cset_choice_time_ms() +
504 phase_times()->young_free_cset_time_ms();
505 }
506
507 double G1DefaultPolicy::non_young_other_time_ms() const {
508 return phase_times()->non_young_cset_choice_time_ms() +
509 phase_times()->non_young_free_cset_time_ms();
510
511 }
512
513 double G1DefaultPolicy::other_time_ms(double pause_time_ms) const {
514 return pause_time_ms - phase_times()->cur_collection_par_time_ms();
515 }
516
517 double G1DefaultPolicy::constant_other_time_ms(double pause_time_ms) const {
518 return other_time_ms(pause_time_ms) - young_other_time_ms() - non_young_other_time_ms();
519 }
520
521 CollectionSetChooser* G1DefaultPolicy::cset_chooser() const {
522 return _collection_set->cset_chooser();
523 }
524
525 bool G1DefaultPolicy::about_to_start_mixed_phase() const {
526 return _g1->concurrent_mark()->cmThread()->during_cycle() || collector_state()->last_young_gc();
527 }
528
529 bool G1DefaultPolicy::need_to_start_conc_mark(const char* source, size_t alloc_word_size) {
530 if (about_to_start_mixed_phase()) {
531 return false;
532 }
533
534 size_t marking_initiating_used_threshold = _ihop_control->get_conc_mark_start_threshold();
535
536 size_t cur_used_bytes = _g1->non_young_capacity_bytes();
537 size_t alloc_byte_size = alloc_word_size * HeapWordSize;
538 size_t marking_request_bytes = cur_used_bytes + alloc_byte_size;
|
484 _mark_cleanup_start_sec = os::elapsedTime();
485 }
486
487 void G1DefaultPolicy::record_concurrent_mark_cleanup_completed() {
488 bool should_continue_with_reclaim = next_gc_should_be_mixed("request last young-only gc",
489 "skip last young-only gc");
490 collector_state()->set_last_young_gc(should_continue_with_reclaim);
491 // We skip the marking phase.
492 if (!should_continue_with_reclaim) {
493 abort_time_to_mixed_tracking();
494 }
495 collector_state()->set_in_marking_window(false);
496 }
497
498 double G1DefaultPolicy::average_time_ms(G1GCPhaseTimes::GCParPhases phase) const {
499 return phase_times()->average_time_ms(phase);
500 }
501
502 double G1DefaultPolicy::young_other_time_ms() const {
503 return phase_times()->young_cset_choice_time_ms() +
504 phase_times()->average_time_ms(G1GCPhaseTimes::YoungFreeCSet);
505 }
506
507 double G1DefaultPolicy::non_young_other_time_ms() const {
508 return phase_times()->non_young_cset_choice_time_ms() +
509 phase_times()->average_time_ms(G1GCPhaseTimes::NonYoungFreeCSet);
510 }
511
512 double G1DefaultPolicy::other_time_ms(double pause_time_ms) const {
513 return pause_time_ms - phase_times()->cur_collection_par_time_ms();
514 }
515
516 double G1DefaultPolicy::constant_other_time_ms(double pause_time_ms) const {
517 return other_time_ms(pause_time_ms) - phase_times()->total_free_cset_time_ms();
518 }
519
520 CollectionSetChooser* G1DefaultPolicy::cset_chooser() const {
521 return _collection_set->cset_chooser();
522 }
523
524 bool G1DefaultPolicy::about_to_start_mixed_phase() const {
525 return _g1->concurrent_mark()->cmThread()->during_cycle() || collector_state()->last_young_gc();
526 }
527
528 bool G1DefaultPolicy::need_to_start_conc_mark(const char* source, size_t alloc_word_size) {
529 if (about_to_start_mixed_phase()) {
530 return false;
531 }
532
533 size_t marking_initiating_used_threshold = _ihop_control->get_conc_mark_start_threshold();
534
535 size_t cur_used_bytes = _g1->non_young_capacity_bytes();
536 size_t alloc_byte_size = alloc_word_size * HeapWordSize;
537 size_t marking_request_bytes = cur_used_bytes + alloc_byte_size;
|