comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 4097:dc467e8b2c5e

7112743: G1: Reduce overhead of marking closure during evacuation pauses Summary: Parallelize the serial code that was used to mark objects reachable from survivor objects in the collection set. Some minor improvments in the timers used to track the freeing of the collection set along with some tweaks to PrintGCDetails. Reviewed-by: tonyp, brutisso
author johnc
date Thu, 17 Nov 2011 12:40:15 -0800
parents 00dd86e542eb
children d23d2b18183e
comparison
equal deleted inserted replaced
4096:00dd86e542eb 4097:dc467e8b2c5e
139 _using_new_ratio_calculations(false), 139 _using_new_ratio_calculations(false),
140 140
141 _summary(new Summary()), 141 _summary(new Summary()),
142 142
143 _cur_clear_ct_time_ms(0.0), 143 _cur_clear_ct_time_ms(0.0),
144 _mark_closure_time_ms(0.0),
144 145
145 _cur_ref_proc_time_ms(0.0), 146 _cur_ref_proc_time_ms(0.0),
146 _cur_ref_enq_time_ms(0.0), 147 _cur_ref_enq_time_ms(0.0),
147 148
148 #ifndef PRODUCT 149 #ifndef PRODUCT
957 _survivors_age_table.clear(); 958 _survivors_age_table.clear();
958 959
959 assert( verify_young_ages(), "region age verification" ); 960 assert( verify_young_ages(), "region age verification" );
960 } 961 }
961 962
962 void G1CollectorPolicy::record_mark_closure_time(double mark_closure_time_ms) {
963 _mark_closure_time_ms = mark_closure_time_ms;
964 }
965
966 void G1CollectorPolicy::record_concurrent_mark_init_end(double 963 void G1CollectorPolicy::record_concurrent_mark_init_end(double
967 mark_init_elapsed_time_ms) { 964 mark_init_elapsed_time_ms) {
968 _during_marking = true; 965 _during_marking = true;
969 assert(!initiate_conc_mark_if_possible(), "we should have cleared it by now"); 966 assert(!initiate_conc_mark_if_possible(), "we should have cleared it by now");
970 clear_during_initial_mark_pause(); 967 clear_during_initial_mark_pause();
1248 } 1245 }
1249 1246
1250 // Subtract the time taken to clean the card table from the 1247 // Subtract the time taken to clean the card table from the
1251 // current value of "other time" 1248 // current value of "other time"
1252 other_time_ms -= _cur_clear_ct_time_ms; 1249 other_time_ms -= _cur_clear_ct_time_ms;
1250
1251 // Subtract the time spent completing marking in the collection
1252 // set. Note if marking is not in progress during the pause
1253 // the value of _mark_closure_time_ms will be zero.
1254 other_time_ms -= _mark_closure_time_ms;
1253 1255
1254 // TraceGen0Time and TraceGen1Time summary info updating. 1256 // TraceGen0Time and TraceGen1Time summary info updating.
1255 _all_pause_times_ms->add(elapsed_ms); 1257 _all_pause_times_ms->add(elapsed_ms);
1256 1258
1257 if (update_stats) { 1259 if (update_stats) {
1405 print_stats(1, "Update RS", update_rs_time); 1407 print_stats(1, "Update RS", update_rs_time);
1406 print_stats(2, "Processed Buffers", (int)update_rs_processed_buffers); 1408 print_stats(2, "Processed Buffers", (int)update_rs_processed_buffers);
1407 print_stats(1, "Scan RS", scan_rs_time); 1409 print_stats(1, "Scan RS", scan_rs_time);
1408 print_stats(1, "Object Copying", obj_copy_time); 1410 print_stats(1, "Object Copying", obj_copy_time);
1409 } 1411 }
1412 if (print_marking_info) {
1413 print_stats(1, "Complete CSet Marking", _mark_closure_time_ms);
1414 }
1410 print_stats(1, "Clear CT", _cur_clear_ct_time_ms); 1415 print_stats(1, "Clear CT", _cur_clear_ct_time_ms);
1411 #ifndef PRODUCT 1416 #ifndef PRODUCT
1412 print_stats(1, "Cur Clear CC", _cur_clear_cc_time_ms); 1417 print_stats(1, "Cur Clear CC", _cur_clear_cc_time_ms);
1413 print_stats(1, "Cum Clear CC", _cum_clear_cc_time_ms); 1418 print_stats(1, "Cum Clear CC", _cum_clear_cc_time_ms);
1414 print_stats(1, "Min Clear CC", _min_clear_cc_time_ms); 1419 print_stats(1, "Min Clear CC", _min_clear_cc_time_ms);
1416 if (_num_cc_clears > 0) { 1421 if (_num_cc_clears > 0) {
1417 print_stats(1, "Avg Clear CC", _cum_clear_cc_time_ms / ((double)_num_cc_clears)); 1422 print_stats(1, "Avg Clear CC", _cum_clear_cc_time_ms / ((double)_num_cc_clears));
1418 } 1423 }
1419 #endif 1424 #endif
1420 print_stats(1, "Other", other_time_ms); 1425 print_stats(1, "Other", other_time_ms);
1421 print_stats(2, "Choose CSet", _recorded_young_cset_choice_time_ms); 1426 print_stats(2, "Choose CSet",
1427 (_recorded_young_cset_choice_time_ms +
1428 _recorded_non_young_cset_choice_time_ms));
1422 print_stats(2, "Ref Proc", _cur_ref_proc_time_ms); 1429 print_stats(2, "Ref Proc", _cur_ref_proc_time_ms);
1423 print_stats(2, "Ref Enq", _cur_ref_enq_time_ms); 1430 print_stats(2, "Ref Enq", _cur_ref_enq_time_ms);
1431 print_stats(2, "Free CSet",
1432 (_recorded_young_free_cset_time_ms +
1433 _recorded_non_young_free_cset_time_ms));
1424 1434
1425 for (int i = 0; i < _aux_num; ++i) { 1435 for (int i = 0; i < _aux_num; ++i) {
1426 if (_cur_aux_times_set[i]) { 1436 if (_cur_aux_times_set[i]) {
1427 char buffer[96]; 1437 char buffer[96];
1428 sprintf(buffer, "Aux%d", i); 1438 sprintf(buffer, "Aux%d", i);