src/share/vm/gc/g1/g1CollectorPolicy.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc/g1

src/share/vm/gc/g1/g1CollectorPolicy.cpp

Print this page




 884   phase_times()->record_cur_collection_start_sec(start_time_sec);
 885   _pending_cards = _g1->pending_card_num();
 886 
 887   _collection_set_bytes_used_before = 0;
 888   _bytes_copied_during_gc = 0;
 889 
 890   collector_state()->set_last_gc_was_young(false);
 891 
 892   // do that for any other surv rate groups
 893   _short_lived_surv_rate_group->stop_adding_regions();
 894   _survivors_age_table.clear();
 895 
 896   assert( verify_young_ages(), "region age verification" );
 897 }
 898 
 899 void G1CollectorPolicy::record_concurrent_mark_init_end(double
 900                                                    mark_init_elapsed_time_ms) {
 901   collector_state()->set_during_marking(true);
 902   assert(!collector_state()->initiate_conc_mark_if_possible(), "we should have cleared it by now");
 903   collector_state()->set_during_initial_mark_pause(false);
 904   _cur_mark_stop_world_time_ms = mark_init_elapsed_time_ms;
 905 }
 906 
 907 void G1CollectorPolicy::record_concurrent_mark_remark_start() {
 908   _mark_remark_start_sec = os::elapsedTime();
 909   collector_state()->set_during_marking(false);
 910 }
 911 
 912 void G1CollectorPolicy::record_concurrent_mark_remark_end() {
 913   double end_time_sec = os::elapsedTime();
 914   double elapsed_time_ms = (end_time_sec - _mark_remark_start_sec)*1000.0;
 915   _concurrent_mark_remark_times_ms->add(elapsed_time_ms);
 916   _cur_mark_stop_world_time_ms += elapsed_time_ms;
 917   _prev_collection_pause_end_ms += elapsed_time_ms;
 918 
 919   record_pause(Remark, _mark_remark_start_sec, end_time_sec);
 920 }
 921 
 922 void G1CollectorPolicy::record_concurrent_mark_cleanup_start() {
 923   _mark_cleanup_start_sec = os::elapsedTime();
 924 }
 925 
 926 void G1CollectorPolicy::record_concurrent_mark_cleanup_completed() {
 927   bool should_continue_with_reclaim = next_gc_should_be_mixed("request last young-only gc",
 928                                                               "skip last young-only gc");
 929   collector_state()->set_last_young_gc(should_continue_with_reclaim);
 930   // We skip the marking phase.
 931   if (!should_continue_with_reclaim) {
 932     abort_time_to_mixed_tracking();
 933   }
 934   collector_state()->set_in_marking_window(false);
 935 }
 936 


1816   return MAX2(n_regions / (n_workers * overpartition_factor), min_chunk_size);
1817 }
1818 
1819 void G1CollectorPolicy::record_concurrent_mark_cleanup_end() {
1820   cset_chooser()->clear();
1821 
1822   WorkGang* workers = _g1->workers();
1823   uint n_workers = workers->active_workers();
1824 
1825   uint n_regions = _g1->num_regions();
1826   uint chunk_size = calculate_parallel_work_chunk_size(n_workers, n_regions);
1827   cset_chooser()->prepare_for_par_region_addition(n_workers, n_regions, chunk_size);
1828   ParKnownGarbageTask par_known_garbage_task(cset_chooser(), chunk_size, n_workers);
1829   workers->run_task(&par_known_garbage_task);
1830 
1831   cset_chooser()->sort_regions();
1832 
1833   double end_sec = os::elapsedTime();
1834   double elapsed_time_ms = (end_sec - _mark_cleanup_start_sec) * 1000.0;
1835   _concurrent_mark_cleanup_times_ms->add(elapsed_time_ms);
1836   _cur_mark_stop_world_time_ms += elapsed_time_ms;
1837   _prev_collection_pause_end_ms += elapsed_time_ms;
1838 
1839   record_pause(Cleanup, _mark_cleanup_start_sec, end_sec);
1840 }
1841 
1842 // Add the heap region at the head of the non-incremental collection set
1843 void G1CollectorPolicy::add_old_region_to_cset(HeapRegion* hr) {
1844   assert(_inc_cset_build_state == Active, "Precondition");
1845   assert(hr->is_old(), "the region should be old");
1846 
1847   assert(!hr->in_collection_set(), "should not already be in the CSet");
1848   _g1->register_old_region_with_cset(hr);
1849   hr->set_next_in_collection_set(_collection_set);
1850   _collection_set = hr;
1851   _collection_set_bytes_used_before += hr->used();
1852   size_t rs_length = hr->rem_set()->occupied();
1853   _recorded_rs_lengths += rs_length;
1854   _old_cset_region_length += 1;
1855 }
1856 




 884   phase_times()->record_cur_collection_start_sec(start_time_sec);
 885   _pending_cards = _g1->pending_card_num();
 886 
 887   _collection_set_bytes_used_before = 0;
 888   _bytes_copied_during_gc = 0;
 889 
 890   collector_state()->set_last_gc_was_young(false);
 891 
 892   // do that for any other surv rate groups
 893   _short_lived_surv_rate_group->stop_adding_regions();
 894   _survivors_age_table.clear();
 895 
 896   assert( verify_young_ages(), "region age verification" );
 897 }
 898 
 899 void G1CollectorPolicy::record_concurrent_mark_init_end(double
 900                                                    mark_init_elapsed_time_ms) {
 901   collector_state()->set_during_marking(true);
 902   assert(!collector_state()->initiate_conc_mark_if_possible(), "we should have cleared it by now");
 903   collector_state()->set_during_initial_mark_pause(false);

 904 }
 905 
 906 void G1CollectorPolicy::record_concurrent_mark_remark_start() {
 907   _mark_remark_start_sec = os::elapsedTime();
 908   collector_state()->set_during_marking(false);
 909 }
 910 
 911 void G1CollectorPolicy::record_concurrent_mark_remark_end() {
 912   double end_time_sec = os::elapsedTime();
 913   double elapsed_time_ms = (end_time_sec - _mark_remark_start_sec)*1000.0;
 914   _concurrent_mark_remark_times_ms->add(elapsed_time_ms);

 915   _prev_collection_pause_end_ms += elapsed_time_ms;
 916 
 917   record_pause(Remark, _mark_remark_start_sec, end_time_sec);
 918 }
 919 
 920 void G1CollectorPolicy::record_concurrent_mark_cleanup_start() {
 921   _mark_cleanup_start_sec = os::elapsedTime();
 922 }
 923 
 924 void G1CollectorPolicy::record_concurrent_mark_cleanup_completed() {
 925   bool should_continue_with_reclaim = next_gc_should_be_mixed("request last young-only gc",
 926                                                               "skip last young-only gc");
 927   collector_state()->set_last_young_gc(should_continue_with_reclaim);
 928   // We skip the marking phase.
 929   if (!should_continue_with_reclaim) {
 930     abort_time_to_mixed_tracking();
 931   }
 932   collector_state()->set_in_marking_window(false);
 933 }
 934 


1814   return MAX2(n_regions / (n_workers * overpartition_factor), min_chunk_size);
1815 }
1816 
1817 void G1CollectorPolicy::record_concurrent_mark_cleanup_end() {
1818   cset_chooser()->clear();
1819 
1820   WorkGang* workers = _g1->workers();
1821   uint n_workers = workers->active_workers();
1822 
1823   uint n_regions = _g1->num_regions();
1824   uint chunk_size = calculate_parallel_work_chunk_size(n_workers, n_regions);
1825   cset_chooser()->prepare_for_par_region_addition(n_workers, n_regions, chunk_size);
1826   ParKnownGarbageTask par_known_garbage_task(cset_chooser(), chunk_size, n_workers);
1827   workers->run_task(&par_known_garbage_task);
1828 
1829   cset_chooser()->sort_regions();
1830 
1831   double end_sec = os::elapsedTime();
1832   double elapsed_time_ms = (end_sec - _mark_cleanup_start_sec) * 1000.0;
1833   _concurrent_mark_cleanup_times_ms->add(elapsed_time_ms);

1834   _prev_collection_pause_end_ms += elapsed_time_ms;
1835 
1836   record_pause(Cleanup, _mark_cleanup_start_sec, end_sec);
1837 }
1838 
1839 // Add the heap region at the head of the non-incremental collection set
1840 void G1CollectorPolicy::add_old_region_to_cset(HeapRegion* hr) {
1841   assert(_inc_cset_build_state == Active, "Precondition");
1842   assert(hr->is_old(), "the region should be old");
1843 
1844   assert(!hr->in_collection_set(), "should not already be in the CSet");
1845   _g1->register_old_region_with_cset(hr);
1846   hr->set_next_in_collection_set(_collection_set);
1847   _collection_set = hr;
1848   _collection_set_bytes_used_before += hr->used();
1849   size_t rs_length = hr->rem_set()->occupied();
1850   _recorded_rs_lengths += rs_length;
1851   _old_cset_region_length += 1;
1852 }
1853 


src/share/vm/gc/g1/g1CollectorPolicy.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File