959 app_time_ms = 1.0; 960 } 961 // We maintain the invariant that all objects allocated by mutator 962 // threads will be allocated out of eden regions. So, we can use 963 // the eden region number allocated since the previous GC to 964 // calculate the application's allocate rate. The only exception 965 // to that is humongous objects that are allocated separately. But 966 // given that humongous object allocations do not really affect 967 // either the pause's duration nor when the next pause will take 968 // place we can safely ignore them here. 969 uint regions_allocated = eden_cset_region_length(); 970 double alloc_rate_ms = (double) regions_allocated / app_time_ms; 971 _alloc_rate_ms_seq->add(alloc_rate_ms); 972 973 double interval_ms = 974 (end_time_sec - _recent_prev_end_times_for_all_gcs_sec->oldest()) * 1000.0; 975 update_recent_gc_times(end_time_sec, pause_time_ms); 976 _recent_avg_pause_time_ratio = _recent_gc_times_ms->sum()/interval_ms; 977 if (recent_avg_pause_time_ratio() < 0.0 || 978 (recent_avg_pause_time_ratio() - 1.0 > 0.0)) { 979 #ifndef PRODUCT 980 // Dump info to allow post-facto debugging 981 gclog_or_tty->print_cr("recent_avg_pause_time_ratio() out of bounds"); 982 gclog_or_tty->print_cr("-------------------------------------------"); 983 gclog_or_tty->print_cr("Recent GC Times (ms):"); 984 _recent_gc_times_ms->dump(); 985 gclog_or_tty->print_cr("(End Time=%3.3f) Recent GC End Times (s):", end_time_sec); 986 _recent_prev_end_times_for_all_gcs_sec->dump(); 987 gclog_or_tty->print_cr("GC = %3.3f, Interval = %3.3f, Ratio = %3.3f", 988 _recent_gc_times_ms->sum(), interval_ms, recent_avg_pause_time_ratio()); 989 // In debug mode, terminate the JVM if the user wants to debug at this point. 990 assert(!G1FailOnFPError, "Debugging data for CR 6898948 has been dumped above"); 991 #endif // !PRODUCT 992 // Clip ratio between 0.0 and 1.0, and continue. This will be fixed in 993 // CR 6902692 by redoing the manner in which the ratio is incrementally computed. 994 if (_recent_avg_pause_time_ratio < 0.0) { 995 _recent_avg_pause_time_ratio = 0.0; 996 } else { 997 assert(_recent_avg_pause_time_ratio - 1.0 > 0.0, "Ctl-point invariant"); 998 _recent_avg_pause_time_ratio = 1.0; 999 } 1000 } 1001 } 1002 1003 bool new_in_marking_window = collector_state()->in_marking_window(); 1004 bool new_in_marking_window_im = false; 1005 if (last_pause_included_initial_mark) { 1006 new_in_marking_window = true; 1007 new_in_marking_window_im = true; 1008 } 1009 1010 if (collector_state()->last_young_gc()) { 1011 // This is supposed to to be the "last young GC" before we start | 959 app_time_ms = 1.0; 960 } 961 // We maintain the invariant that all objects allocated by mutator 962 // threads will be allocated out of eden regions. So, we can use 963 // the eden region number allocated since the previous GC to 964 // calculate the application's allocate rate. The only exception 965 // to that is humongous objects that are allocated separately. But 966 // given that humongous object allocations do not really affect 967 // either the pause's duration nor when the next pause will take 968 // place we can safely ignore them here. 969 uint regions_allocated = eden_cset_region_length(); 970 double alloc_rate_ms = (double) regions_allocated / app_time_ms; 971 _alloc_rate_ms_seq->add(alloc_rate_ms); 972 973 double interval_ms = 974 (end_time_sec - _recent_prev_end_times_for_all_gcs_sec->oldest()) * 1000.0; 975 update_recent_gc_times(end_time_sec, pause_time_ms); 976 _recent_avg_pause_time_ratio = _recent_gc_times_ms->sum()/interval_ms; 977 if (recent_avg_pause_time_ratio() < 0.0 || 978 (recent_avg_pause_time_ratio() - 1.0 > 0.0)) { 979 // Clip ratio between 0.0 and 1.0, and continue. This will be fixed in 980 // CR 6902692 by redoing the manner in which the ratio is incrementally computed. 981 if (_recent_avg_pause_time_ratio < 0.0) { 982 _recent_avg_pause_time_ratio = 0.0; 983 } else { 984 assert(_recent_avg_pause_time_ratio - 1.0 > 0.0, "Ctl-point invariant"); 985 _recent_avg_pause_time_ratio = 1.0; 986 } 987 } 988 } 989 990 bool new_in_marking_window = collector_state()->in_marking_window(); 991 bool new_in_marking_window_im = false; 992 if (last_pause_included_initial_mark) { 993 new_in_marking_window = true; 994 new_in_marking_window_im = true; 995 } 996 997 if (collector_state()->last_young_gc()) { 998 // This is supposed to to be the "last young GC" before we start |