50 SystemDictionaryRoots,
51 CLDGRoots,
52 JVMTIRoots,
53 CMRefRoots,
54 WaitForStrongCLD,
55 WeakCLDRoots,
56 SATBFiltering,
57 UpdateRS,
58 ScanHCC,
59 ScanRS,
60 CodeRoots,
61 ObjCopy,
62 Termination,
63 Other,
64 GCWorkerTotal,
65 GCWorkerEnd,
66 StringDedupQueueFixup,
67 StringDedupTableFixup,
68 RedirtyCards,
69 PreserveCMReferents,
70 GCParPhasesSentinel
71 };
72
73 private:
74 // Markers for grouping the phases in the GCPhases enum above
75 static const int GCMainParPhasesLast = GCWorkerEnd;
76 static const int StringDedupPhasesFirst = StringDedupQueueFixup;
77 static const int StringDedupPhasesLast = StringDedupTableFixup;
78
79 WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
80 WorkerDataArray<size_t>* _update_rs_processed_buffers;
81 WorkerDataArray<size_t>* _termination_attempts;
82 WorkerDataArray<size_t>* _redirtied_cards;
83
84 double _cur_collection_par_time_ms;
85 double _cur_collection_code_root_fixup_time_ms;
86 double _cur_strong_code_root_purge_time_ms;
87
88 double _cur_evac_fail_recalc_used;
89 double _cur_evac_fail_restore_remsets;
93
94 double _cur_clear_ct_time_ms;
95 double _cur_expand_heap_time_ms;
96 double _cur_ref_proc_time_ms;
97 double _cur_ref_enq_time_ms;
98
99 double _cur_collection_start_sec;
100 double _root_region_scan_wait_time_ms;
101
102 double _external_accounted_time_ms;
103
104 double _recorded_young_cset_choice_time_ms;
105 double _recorded_non_young_cset_choice_time_ms;
106
107 double _recorded_redirty_logged_cards_time_ms;
108
109 double _recorded_preserve_cm_referents_time_ms;
110
111 double _recorded_merge_pss_time_ms;
112
113 double _recorded_young_free_cset_time_ms;
114 double _recorded_non_young_free_cset_time_ms;
115
116 double _cur_fast_reclaim_humongous_time_ms;
117 double _cur_fast_reclaim_humongous_register_time_ms;
118 size_t _cur_fast_reclaim_humongous_total;
119 size_t _cur_fast_reclaim_humongous_candidates;
120 size_t _cur_fast_reclaim_humongous_reclaimed;
121
122 double _cur_verify_before_time_ms;
123 double _cur_verify_after_time_ms;
124
125 double worker_time(GCParPhases phase, uint worker);
126 void note_gc_end();
127
128 template <class T>
129 void details(T* phase, const char* indent);
130 void log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum);
131 void debug_phase(WorkerDataArray<double>* phase);
132 void trace_phase(WorkerDataArray<double>* phase, bool print_sum = true);
133
134 public:
182 void record_evac_fail_remove_self_forwards(double ms) {
183 _cur_evac_fail_remove_self_forwards = ms;
184 }
185
186 void record_string_dedup_fixup_time(double ms) {
187 _cur_string_dedup_fixup_time_ms = ms;
188 }
189
190 void record_ref_proc_time(double ms) {
191 _cur_ref_proc_time_ms = ms;
192 }
193
194 void record_ref_enq_time(double ms) {
195 _cur_ref_enq_time_ms = ms;
196 }
197
198 void record_root_region_scan_wait_time(double time_ms) {
199 _root_region_scan_wait_time_ms = time_ms;
200 }
201
202 void record_young_free_cset_time_ms(double time_ms) {
203 _recorded_young_free_cset_time_ms = time_ms;
204 }
205
206 void record_non_young_free_cset_time_ms(double time_ms) {
207 _recorded_non_young_free_cset_time_ms = time_ms;
208 }
209
210 void record_fast_reclaim_humongous_stats(double time_ms, size_t total, size_t candidates) {
211 _cur_fast_reclaim_humongous_register_time_ms = time_ms;
212 _cur_fast_reclaim_humongous_total = total;
213 _cur_fast_reclaim_humongous_candidates = candidates;
214 }
215
216 void record_fast_reclaim_humongous_time_ms(double value, size_t reclaimed) {
217 _cur_fast_reclaim_humongous_time_ms = value;
218 _cur_fast_reclaim_humongous_reclaimed = reclaimed;
219 }
220
221 void record_young_cset_choice_time_ms(double time_ms) {
222 _recorded_young_cset_choice_time_ms = time_ms;
223 }
224
225 void record_non_young_cset_choice_time_ms(double time_ms) {
226 _recorded_non_young_cset_choice_time_ms = time_ms;
227 }
261 double cur_collection_par_time_ms() {
262 return _cur_collection_par_time_ms;
263 }
264
265 double cur_clear_ct_time_ms() {
266 return _cur_clear_ct_time_ms;
267 }
268
269 double cur_expand_heap_time_ms() {
270 return _cur_expand_heap_time_ms;
271 }
272
273 double root_region_scan_wait_time_ms() {
274 return _root_region_scan_wait_time_ms;
275 }
276
277 double young_cset_choice_time_ms() {
278 return _recorded_young_cset_choice_time_ms;
279 }
280
281 double young_free_cset_time_ms() {
282 return _recorded_young_free_cset_time_ms;
283 }
284
285 double non_young_cset_choice_time_ms() {
286 return _recorded_non_young_cset_choice_time_ms;
287 }
288
289 double non_young_free_cset_time_ms() {
290 return _recorded_non_young_free_cset_time_ms;
291 }
292
293 double fast_reclaim_humongous_time_ms() {
294 return _cur_fast_reclaim_humongous_time_ms;
295 }
296 };
297
298 class G1GCParPhaseTimesTracker : public StackObj {
299 double _start_time;
300 G1GCPhaseTimes::GCParPhases _phase;
301 G1GCPhaseTimes* _phase_times;
302 uint _worker_id;
303 public:
304 G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
305 ~G1GCParPhaseTimesTracker();
306 };
307
308 #endif // SHARE_VM_GC_G1_G1GCPHASETIMES_HPP
|
50 SystemDictionaryRoots,
51 CLDGRoots,
52 JVMTIRoots,
53 CMRefRoots,
54 WaitForStrongCLD,
55 WeakCLDRoots,
56 SATBFiltering,
57 UpdateRS,
58 ScanHCC,
59 ScanRS,
60 CodeRoots,
61 ObjCopy,
62 Termination,
63 Other,
64 GCWorkerTotal,
65 GCWorkerEnd,
66 StringDedupQueueFixup,
67 StringDedupTableFixup,
68 RedirtyCards,
69 PreserveCMReferents,
70 YoungFreeCSet,
71 NonYoungFreeCSet,
72 GCParPhasesSentinel
73 };
74
75 private:
76 // Markers for grouping the phases in the GCPhases enum above
77 static const int GCMainParPhasesLast = GCWorkerEnd;
78 static const int StringDedupPhasesFirst = StringDedupQueueFixup;
79 static const int StringDedupPhasesLast = StringDedupTableFixup;
80
81 WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
82 WorkerDataArray<size_t>* _update_rs_processed_buffers;
83 WorkerDataArray<size_t>* _termination_attempts;
84 WorkerDataArray<size_t>* _redirtied_cards;
85
86 double _cur_collection_par_time_ms;
87 double _cur_collection_code_root_fixup_time_ms;
88 double _cur_strong_code_root_purge_time_ms;
89
90 double _cur_evac_fail_recalc_used;
91 double _cur_evac_fail_restore_remsets;
95
96 double _cur_clear_ct_time_ms;
97 double _cur_expand_heap_time_ms;
98 double _cur_ref_proc_time_ms;
99 double _cur_ref_enq_time_ms;
100
101 double _cur_collection_start_sec;
102 double _root_region_scan_wait_time_ms;
103
104 double _external_accounted_time_ms;
105
106 double _recorded_young_cset_choice_time_ms;
107 double _recorded_non_young_cset_choice_time_ms;
108
109 double _recorded_redirty_logged_cards_time_ms;
110
111 double _recorded_preserve_cm_referents_time_ms;
112
113 double _recorded_merge_pss_time_ms;
114
115 double _recorded_total_free_cset_time_ms;
116
117 double _recorded_serial_free_cset_time_ms;
118
119 double _cur_fast_reclaim_humongous_time_ms;
120 double _cur_fast_reclaim_humongous_register_time_ms;
121 size_t _cur_fast_reclaim_humongous_total;
122 size_t _cur_fast_reclaim_humongous_candidates;
123 size_t _cur_fast_reclaim_humongous_reclaimed;
124
125 double _cur_verify_before_time_ms;
126 double _cur_verify_after_time_ms;
127
128 double worker_time(GCParPhases phase, uint worker);
129 void note_gc_end();
130
131 template <class T>
132 void details(T* phase, const char* indent);
133 void log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum);
134 void debug_phase(WorkerDataArray<double>* phase);
135 void trace_phase(WorkerDataArray<double>* phase, bool print_sum = true);
136
137 public:
185 void record_evac_fail_remove_self_forwards(double ms) {
186 _cur_evac_fail_remove_self_forwards = ms;
187 }
188
189 void record_string_dedup_fixup_time(double ms) {
190 _cur_string_dedup_fixup_time_ms = ms;
191 }
192
193 void record_ref_proc_time(double ms) {
194 _cur_ref_proc_time_ms = ms;
195 }
196
197 void record_ref_enq_time(double ms) {
198 _cur_ref_enq_time_ms = ms;
199 }
200
201 void record_root_region_scan_wait_time(double time_ms) {
202 _root_region_scan_wait_time_ms = time_ms;
203 }
204
205 void record_total_free_cset_time_ms(double time_ms) {
206 _recorded_total_free_cset_time_ms = time_ms;
207 }
208
209 void record_serial_free_cset_time_ms(double time_ms) {
210 _recorded_serial_free_cset_time_ms = time_ms;
211 }
212
213 void record_fast_reclaim_humongous_stats(double time_ms, size_t total, size_t candidates) {
214 _cur_fast_reclaim_humongous_register_time_ms = time_ms;
215 _cur_fast_reclaim_humongous_total = total;
216 _cur_fast_reclaim_humongous_candidates = candidates;
217 }
218
219 void record_fast_reclaim_humongous_time_ms(double value, size_t reclaimed) {
220 _cur_fast_reclaim_humongous_time_ms = value;
221 _cur_fast_reclaim_humongous_reclaimed = reclaimed;
222 }
223
224 void record_young_cset_choice_time_ms(double time_ms) {
225 _recorded_young_cset_choice_time_ms = time_ms;
226 }
227
228 void record_non_young_cset_choice_time_ms(double time_ms) {
229 _recorded_non_young_cset_choice_time_ms = time_ms;
230 }
264 double cur_collection_par_time_ms() {
265 return _cur_collection_par_time_ms;
266 }
267
268 double cur_clear_ct_time_ms() {
269 return _cur_clear_ct_time_ms;
270 }
271
272 double cur_expand_heap_time_ms() {
273 return _cur_expand_heap_time_ms;
274 }
275
276 double root_region_scan_wait_time_ms() {
277 return _root_region_scan_wait_time_ms;
278 }
279
280 double young_cset_choice_time_ms() {
281 return _recorded_young_cset_choice_time_ms;
282 }
283
284 double total_free_cset_time_ms() {
285 return _recorded_total_free_cset_time_ms;
286 }
287
288 double non_young_cset_choice_time_ms() {
289 return _recorded_non_young_cset_choice_time_ms;
290 }
291
292 double fast_reclaim_humongous_time_ms() {
293 return _cur_fast_reclaim_humongous_time_ms;
294 }
295 };
296
297 class G1GCParPhaseTimesTracker : public StackObj {
298 double _start_time;
299 G1GCPhaseTimes::GCParPhases _phase;
300 G1GCPhaseTimes* _phase_times;
301 uint _worker_id;
302 public:
303 G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
304 ~G1GCParPhaseTimesTracker();
305 };
306
307 #endif // SHARE_VM_GC_G1_G1GCPHASETIMES_HPP
|