src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
Print this page
rev 6347 : 8042298: Remove the names gen0 and gen1 from the GC code
Summary: Renamed gen0 and gen1 to young and old throughout the GC code.
Reviewed-by:
*** 802,812 ****
// since last pause.
double end_sec = os::elapsedTime();
double full_gc_time_sec = end_sec - _full_collection_start_sec;
double full_gc_time_ms = full_gc_time_sec * 1000.0;
! _trace_gen1_time_data.record_full_collection(full_gc_time_ms);
update_recent_gc_times(end_sec, full_gc_time_ms);
_g1->clear_full_collection();
--- 802,812 ----
// since last pause.
double end_sec = os::elapsedTime();
double full_gc_time_sec = end_sec - _full_collection_start_sec;
double full_gc_time_ms = full_gc_time_sec * 1000.0;
! _trace_old_gen_time_data.record_full_collection(full_gc_time_ms);
update_recent_gc_times(end_sec, full_gc_time_ms);
_g1->clear_full_collection();
*** 844,854 ****
assert(_g1->used() == _g1->recalculate_used(),
err_msg("sanity, used: "SIZE_FORMAT" recalculate_used: "SIZE_FORMAT,
_g1->used(), _g1->recalculate_used()));
double s_w_t_ms = (start_time_sec - _stop_world_start) * 1000.0;
! _trace_gen0_time_data.record_start_collection(s_w_t_ms);
_stop_world_start = 0.0;
record_heap_size_info_at_start(false /* full */);
phase_times()->record_cur_collection_start_sec(start_time_sec);
--- 844,854 ----
assert(_g1->used() == _g1->recalculate_used(),
err_msg("sanity, used: "SIZE_FORMAT" recalculate_used: "SIZE_FORMAT,
_g1->used(), _g1->recalculate_used()));
double s_w_t_ms = (start_time_sec - _stop_world_start) * 1000.0;
! _trace_young_gen_time_data.record_start_collection(s_w_t_ms);
_stop_world_start = 0.0;
record_heap_size_info_at_start(false /* full */);
phase_times()->record_cur_collection_start_sec(start_time_sec);
*** 899,909 ****
}
void G1CollectorPolicy::record_concurrent_pause() {
if (_stop_world_start > 0.0) {
double yield_ms = (os::elapsedTime() - _stop_world_start) * 1000.0;
! _trace_gen0_time_data.record_yield_time(yield_ms);
}
}
bool G1CollectorPolicy::need_to_start_conc_mark(const char* source, size_t alloc_word_size) {
if (_g1->concurrent_mark()->cmThread()->during_cycle()) {
--- 899,909 ----
}
void G1CollectorPolicy::record_concurrent_pause() {
if (_stop_world_start > 0.0) {
double yield_ms = (os::elapsedTime() - _stop_world_start) * 1000.0;
! _trace_young_gen_time_data.record_yield_time(yield_ms);
}
}
bool G1CollectorPolicy::need_to_start_conc_mark(const char* source, size_t alloc_word_size) {
if (_g1->concurrent_mark()->cmThread()->during_cycle()) {
*** 986,996 ****
evacuation_info.set_collectionset_used_before(_collection_set_bytes_used_before);
evacuation_info.set_bytes_copied(_bytes_copied_during_gc);
if (update_stats) {
! _trace_gen0_time_data.record_end_collection(pause_time_ms, phase_times());
// this is where we update the allocation rate of the application
double app_time_ms =
(phase_times()->cur_collection_start_sec() * 1000.0 - _prev_collection_pause_end_ms);
if (app_time_ms < MIN_TIMER_GRANULARITY) {
// This usually happens due to the timer not having the required
--- 986,996 ----
evacuation_info.set_collectionset_used_before(_collection_set_bytes_used_before);
evacuation_info.set_bytes_copied(_bytes_copied_during_gc);
if (update_stats) {
! _trace_young_gen_time_data.record_end_collection(pause_time_ms, phase_times());
// this is where we update the allocation rate of the application
double app_time_ms =
(phase_times()->cur_collection_start_sec() * 1000.0 - _prev_collection_pause_end_ms);
if (app_time_ms < MIN_TIMER_GRANULARITY) {
// This usually happens due to the timer not having the required
*** 1408,1419 ****
return 0;
}
}
void G1CollectorPolicy::print_tracing_info() const {
! _trace_gen0_time_data.print();
! _trace_gen1_time_data.print();
}
void G1CollectorPolicy::print_yg_surv_rate_info() const {
#ifndef PRODUCT
_short_lived_surv_rate_group->print_surv_rate_summary();
--- 1408,1419 ----
return 0;
}
}
void G1CollectorPolicy::print_tracing_info() const {
! _trace_young_gen_time_data.print();
! _trace_old_gen_time_data.print();
}
void G1CollectorPolicy::print_yg_surv_rate_info() const {
#ifndef PRODUCT
_short_lived_surv_rate_group->print_surv_rate_summary();
*** 1966,1978 ****
_pending_cards, base_time_ms, time_remaining_ms, target_pause_time_ms);
_last_gc_was_young = gcs_are_young() ? true : false;
if (_last_gc_was_young) {
! _trace_gen0_time_data.increment_young_collection_count();
} else {
! _trace_gen0_time_data.increment_mixed_collection_count();
}
// The young list is laid with the survivor regions from the previous
// pause are appended to the RHS of the young list, i.e.
// [Newly Young Regions ++ Survivors from last pause].
--- 1966,1978 ----
_pending_cards, base_time_ms, time_remaining_ms, target_pause_time_ms);
_last_gc_was_young = gcs_are_young() ? true : false;
if (_last_gc_was_young) {
! _trace_young_gen_time_data.increment_young_collection_count();
} else {
! _trace_young_gen_time_data.increment_mixed_collection_count();
}
// The young list is laid with the survivor regions from the previous
// pause are appended to the RHS of the young list, i.e.
// [Newly Young Regions ++ Survivors from last pause].
*** 2149,2171 ****
double non_young_end_time_sec = os::elapsedTime();
phase_times()->record_non_young_cset_choice_time_ms((non_young_end_time_sec - non_young_start_time_sec) * 1000.0);
evacuation_info.set_collectionset_regions(cset_region_length());
}
! void TraceGen0TimeData::record_start_collection(double time_to_stop_the_world_ms) {
if(TraceGen0Time) {
_all_stop_world_times_ms.add(time_to_stop_the_world_ms);
}
}
! void TraceGen0TimeData::record_yield_time(double yield_time_ms) {
if(TraceGen0Time) {
_all_yield_times_ms.add(yield_time_ms);
}
}
! void TraceGen0TimeData::record_end_collection(double pause_time_ms, G1GCPhaseTimes* phase_times) {
if(TraceGen0Time) {
_total.add(pause_time_ms);
_other.add(pause_time_ms - phase_times->accounted_time_ms());
_root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
_parallel.add(phase_times->cur_collection_par_time_ms());
--- 2149,2171 ----
double non_young_end_time_sec = os::elapsedTime();
phase_times()->record_non_young_cset_choice_time_ms((non_young_end_time_sec - non_young_start_time_sec) * 1000.0);
evacuation_info.set_collectionset_regions(cset_region_length());
}
! void TraceYoungGenTimeData::record_start_collection(double time_to_stop_the_world_ms) {
if(TraceGen0Time) {
_all_stop_world_times_ms.add(time_to_stop_the_world_ms);
}
}
! void TraceYoungGenTimeData::record_yield_time(double yield_time_ms) {
if(TraceGen0Time) {
_all_yield_times_ms.add(yield_time_ms);
}
}
! void TraceYoungGenTimeData::record_end_collection(double pause_time_ms, G1GCPhaseTimes* phase_times) {
if(TraceGen0Time) {
_total.add(pause_time_ms);
_other.add(pause_time_ms - phase_times->accounted_time_ms());
_root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
_parallel.add(phase_times->cur_collection_par_time_ms());
*** 2187,2223 ****
_parallel_other.add(parallel_other_time);
_clear_ct.add(phase_times->cur_clear_ct_time_ms());
}
}
! void TraceGen0TimeData::increment_young_collection_count() {
if(TraceGen0Time) {
++_young_pause_num;
}
}
! void TraceGen0TimeData::increment_mixed_collection_count() {
if(TraceGen0Time) {
++_mixed_pause_num;
}
}
! void TraceGen0TimeData::print_summary(const char* str,
const NumberSeq* seq) const {
double sum = seq->sum();
gclog_or_tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)",
str, sum / 1000.0, seq->avg());
}
! void TraceGen0TimeData::print_summary_sd(const char* str,
const NumberSeq* seq) const {
print_summary(str, seq);
gclog_or_tty->print_cr("%+45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)",
"(num", seq->num(), seq->sd(), seq->maximum());
}
! void TraceGen0TimeData::print() const {
if (!TraceGen0Time) {
return;
}
gclog_or_tty->print_cr("ALL PAUSES");
--- 2187,2223 ----
_parallel_other.add(parallel_other_time);
_clear_ct.add(phase_times->cur_clear_ct_time_ms());
}
}
! void TraceYoungGenTimeData::increment_young_collection_count() {
if(TraceGen0Time) {
++_young_pause_num;
}
}
! void TraceYoungGenTimeData::increment_mixed_collection_count() {
if(TraceGen0Time) {
++_mixed_pause_num;
}
}
! void TraceYoungGenTimeData::print_summary(const char* str,
const NumberSeq* seq) const {
double sum = seq->sum();
gclog_or_tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)",
str, sum / 1000.0, seq->avg());
}
! void TraceYoungGenTimeData::print_summary_sd(const char* str,
const NumberSeq* seq) const {
print_summary(str, seq);
gclog_or_tty->print_cr("%+45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)",
"(num", seq->num(), seq->sd(), seq->maximum());
}
! void TraceYoungGenTimeData::print() const {
if (!TraceGen0Time) {
return;
}
gclog_or_tty->print_cr("ALL PAUSES");
*** 2251,2267 ****
gclog_or_tty->print_cr("MISC");
print_summary_sd(" Stop World", &_all_stop_world_times_ms);
print_summary_sd(" Yields", &_all_yield_times_ms);
}
! void TraceGen1TimeData::record_full_collection(double full_gc_time_ms) {
if (TraceGen1Time) {
_all_full_gc_times.add(full_gc_time_ms);
}
}
! void TraceGen1TimeData::print() const {
if (!TraceGen1Time) {
return;
}
if (_all_full_gc_times.num() > 0) {
--- 2251,2267 ----
gclog_or_tty->print_cr("MISC");
print_summary_sd(" Stop World", &_all_stop_world_times_ms);
print_summary_sd(" Yields", &_all_yield_times_ms);
}
! void TraceOldGenTimeData::record_full_collection(double full_gc_time_ms) {
if (TraceGen1Time) {
_all_full_gc_times.add(full_gc_time_ms);
}
}
! void TraceOldGenTimeData::print() const {
if (!TraceGen1Time) {
return;
}
if (_all_full_gc_times.num() > 0) {
src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File