49 assert(max_gc_threads > 0, "Must have some GC threads");
50
51 _gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms):");
52 _gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms):");
53
54 // Root scanning phases
55 _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms):");
56 _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms):");
57 _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms):");
58 _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms):");
59 _gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms):");
60 _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms):");
61 _gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms):");
62 _gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms):");
63 AOT_ONLY(_gc_par_phases[AOTCodeRoots] = new WorkerDataArray<double>(max_gc_threads, "AOT Root Scan (ms):");)
64 JVMCI_ONLY(_gc_par_phases[JVMCIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMCI Root Scan (ms):");)
65 _gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms):");
66 _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms):");
67 _gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms):");
68
69 _gc_par_phases[UpdateRS] = new WorkerDataArray<double>(max_gc_threads, "Update RS (ms):");
70 if (G1HotCardCache::default_use_cache()) {
71 _gc_par_phases[ScanHCC] = new WorkerDataArray<double>(max_gc_threads, "Scan HCC (ms):");
72 } else {
73 _gc_par_phases[ScanHCC] = NULL;
74 }
75 _gc_par_phases[ScanRS] = new WorkerDataArray<double>(max_gc_threads, "Scan RS (ms):");
76 _gc_par_phases[OptScanRS] = new WorkerDataArray<double>(max_gc_threads, "Optional Scan RS (ms):");
77 _gc_par_phases[CodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Code Root Scan (ms):");
78 _gc_par_phases[OptCodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Optional Code Root Scan (ms):");
79 _gc_par_phases[ObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Object Copy (ms):");
80 _gc_par_phases[OptObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Optional Object Copy (ms):");
81 _gc_par_phases[Termination] = new WorkerDataArray<double>(max_gc_threads, "Termination (ms):");
82 _gc_par_phases[OptTermination] = new WorkerDataArray<double>(max_gc_threads, "Optional Termination (ms):");
83 _gc_par_phases[GCWorkerTotal] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Total (ms):");
84 _gc_par_phases[GCWorkerEnd] = new WorkerDataArray<double>(max_gc_threads, "GC Worker End (ms):");
85 _gc_par_phases[Other] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Other (ms):");
86
87 _scan_rs_scanned_cards = new WorkerDataArray<size_t>(max_gc_threads, "Scanned Cards:");
88 _gc_par_phases[ScanRS]->link_thread_work_items(_scan_rs_scanned_cards, ScanRSScannedCards);
394 debug_phase(_gc_par_phases[OptObjCopy]);
395 debug_phase(_gc_par_phases[OptCodeRoots]);
396 debug_phase(_gc_par_phases[OptTermination]);
397 }
398 return sum_ms;
399 }
400
401 double G1GCPhaseTimes::print_evacuate_collection_set() const {
402 const double sum_ms = _cur_collection_initial_evac_time_ms;
403
404 info_time("Evacuate Collection Set", sum_ms);
405
406 trace_phase(_gc_par_phases[GCWorkerStart], false);
407 debug_phase(_gc_par_phases[ExtRootScan]);
408 for (int i = ExtRootScanSubPhasesFirst; i <= ExtRootScanSubPhasesLast; i++) {
409 trace_phase(_gc_par_phases[i]);
410 }
411 if (G1HotCardCache::default_use_cache()) {
412 debug_phase(_gc_par_phases[ScanHCC]);
413 }
414 debug_phase(_gc_par_phases[UpdateRS]);
415 debug_phase(_gc_par_phases[ScanRS]);
416 debug_phase(_gc_par_phases[CodeRoots]);
417 debug_phase(_gc_par_phases[ObjCopy]);
418 debug_phase(_gc_par_phases[Termination]);
419 debug_phase(_gc_par_phases[Other]);
420 debug_phase(_gc_par_phases[GCWorkerTotal]);
421 trace_phase(_gc_par_phases[GCWorkerEnd], false);
422
423 return sum_ms;
424 }
425
426 double G1GCPhaseTimes::print_post_evacuate_collection_set() const {
427 const double evac_fail_handling = _cur_evac_fail_recalc_used +
428 _cur_evac_fail_remove_self_forwards;
429 const double sum_ms = evac_fail_handling +
430 _cur_collection_code_root_fixup_time_ms +
431 _recorded_preserve_cm_referents_time_ms +
432 _cur_ref_proc_time_ms +
433 (_weak_phase_times.total_time_sec() * MILLIUNITS) +
434 _cur_clear_ct_time_ms +
513 }
514 }
515
516 const char* G1GCPhaseTimes::phase_name(GCParPhases phase) {
517 static const char* names[] = {
518 "GCWorkerStart",
519 "ExtRootScan",
520 "ThreadRoots",
521 "UniverseRoots",
522 "JNIRoots",
523 "ObjectSynchronizerRoots",
524 "ManagementRoots",
525 "SystemDictionaryRoots",
526 "CLDGRoots",
527 "JVMTIRoots",
528 AOT_ONLY("AOTCodeRoots" COMMA)
529 JVMCI_ONLY("JVMCIRoots" COMMA)
530 "CMRefRoots",
531 "WaitForStrongCLD",
532 "WeakCLDRoots",
533 "UpdateRS",
534 "ScanHCC",
535 "ScanRS",
536 "OptScanRS",
537 "CodeRoots",
538 "OptCodeRoots",
539 "ObjCopy",
540 "OptObjCopy",
541 "Termination",
542 "OptTermination",
543 "Other",
544 "GCWorkerTotal",
545 "GCWorkerEnd",
546 "StringDedupQueueFixup",
547 "StringDedupTableFixup",
548 "RedirtyCards",
549 "YoungFreeCSet",
550 "NonYoungFreeCSet"
551 //GCParPhasesSentinel only used to tell end of enum
552 };
|
49 assert(max_gc_threads > 0, "Must have some GC threads");
50
51 _gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms):");
52 _gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms):");
53
54 // Root scanning phases
55 _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms):");
56 _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms):");
57 _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms):");
58 _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms):");
59 _gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms):");
60 _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms):");
61 _gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms):");
62 _gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms):");
63 AOT_ONLY(_gc_par_phases[AOTCodeRoots] = new WorkerDataArray<double>(max_gc_threads, "AOT Root Scan (ms):");)
64 JVMCI_ONLY(_gc_par_phases[JVMCIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMCI Root Scan (ms):");)
65 _gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms):");
66 _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms):");
67 _gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms):");
68
69 if (G1FastWriteBarrier) {
70 _gc_par_phases[ProcessCardTable] = new WorkerDataArray<double>(max_gc_threads, "Process CardTable (ms):");
71 } else {
72 _gc_par_phases[ProcessCardTable] = NULL;
73 }
74 _gc_par_phases[UpdateRS] = new WorkerDataArray<double>(max_gc_threads, "Update RS (ms):");
75 if (G1HotCardCache::default_use_cache()) {
76 _gc_par_phases[ScanHCC] = new WorkerDataArray<double>(max_gc_threads, "Scan HCC (ms):");
77 } else {
78 _gc_par_phases[ScanHCC] = NULL;
79 }
80 _gc_par_phases[ScanRS] = new WorkerDataArray<double>(max_gc_threads, "Scan RS (ms):");
81 _gc_par_phases[OptScanRS] = new WorkerDataArray<double>(max_gc_threads, "Optional Scan RS (ms):");
82 _gc_par_phases[CodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Code Root Scan (ms):");
83 _gc_par_phases[OptCodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Optional Code Root Scan (ms):");
84 _gc_par_phases[ObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Object Copy (ms):");
85 _gc_par_phases[OptObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Optional Object Copy (ms):");
86 _gc_par_phases[Termination] = new WorkerDataArray<double>(max_gc_threads, "Termination (ms):");
87 _gc_par_phases[OptTermination] = new WorkerDataArray<double>(max_gc_threads, "Optional Termination (ms):");
88 _gc_par_phases[GCWorkerTotal] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Total (ms):");
89 _gc_par_phases[GCWorkerEnd] = new WorkerDataArray<double>(max_gc_threads, "GC Worker End (ms):");
90 _gc_par_phases[Other] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Other (ms):");
91
92 _scan_rs_scanned_cards = new WorkerDataArray<size_t>(max_gc_threads, "Scanned Cards:");
93 _gc_par_phases[ScanRS]->link_thread_work_items(_scan_rs_scanned_cards, ScanRSScannedCards);
399 debug_phase(_gc_par_phases[OptObjCopy]);
400 debug_phase(_gc_par_phases[OptCodeRoots]);
401 debug_phase(_gc_par_phases[OptTermination]);
402 }
403 return sum_ms;
404 }
405
406 double G1GCPhaseTimes::print_evacuate_collection_set() const {
407 const double sum_ms = _cur_collection_initial_evac_time_ms;
408
409 info_time("Evacuate Collection Set", sum_ms);
410
411 trace_phase(_gc_par_phases[GCWorkerStart], false);
412 debug_phase(_gc_par_phases[ExtRootScan]);
413 for (int i = ExtRootScanSubPhasesFirst; i <= ExtRootScanSubPhasesLast; i++) {
414 trace_phase(_gc_par_phases[i]);
415 }
416 if (G1HotCardCache::default_use_cache()) {
417 debug_phase(_gc_par_phases[ScanHCC]);
418 }
419 if (G1FastWriteBarrier) {
420 debug_phase(_gc_par_phases[ProcessCardTable]);
421 } else {
422 debug_phase(_gc_par_phases[UpdateRS]);
423 }
424 debug_phase(_gc_par_phases[ScanRS]);
425 debug_phase(_gc_par_phases[CodeRoots]);
426 debug_phase(_gc_par_phases[ObjCopy]);
427 debug_phase(_gc_par_phases[Termination]);
428 debug_phase(_gc_par_phases[Other]);
429 debug_phase(_gc_par_phases[GCWorkerTotal]);
430 trace_phase(_gc_par_phases[GCWorkerEnd], false);
431
432 return sum_ms;
433 }
434
435 double G1GCPhaseTimes::print_post_evacuate_collection_set() const {
436 const double evac_fail_handling = _cur_evac_fail_recalc_used +
437 _cur_evac_fail_remove_self_forwards;
438 const double sum_ms = evac_fail_handling +
439 _cur_collection_code_root_fixup_time_ms +
440 _recorded_preserve_cm_referents_time_ms +
441 _cur_ref_proc_time_ms +
442 (_weak_phase_times.total_time_sec() * MILLIUNITS) +
443 _cur_clear_ct_time_ms +
522 }
523 }
524
525 const char* G1GCPhaseTimes::phase_name(GCParPhases phase) {
526 static const char* names[] = {
527 "GCWorkerStart",
528 "ExtRootScan",
529 "ThreadRoots",
530 "UniverseRoots",
531 "JNIRoots",
532 "ObjectSynchronizerRoots",
533 "ManagementRoots",
534 "SystemDictionaryRoots",
535 "CLDGRoots",
536 "JVMTIRoots",
537 AOT_ONLY("AOTCodeRoots" COMMA)
538 JVMCI_ONLY("JVMCIRoots" COMMA)
539 "CMRefRoots",
540 "WaitForStrongCLD",
541 "WeakCLDRoots",
542 "ProcessCardTable",
543 "UpdateRS",
544 "ScanHCC",
545 "ScanRS",
546 "OptScanRS",
547 "CodeRoots",
548 "OptCodeRoots",
549 "ObjCopy",
550 "OptObjCopy",
551 "Termination",
552 "OptTermination",
553 "Other",
554 "GCWorkerTotal",
555 "GCWorkerEnd",
556 "StringDedupQueueFixup",
557 "StringDedupTableFixup",
558 "RedirtyCards",
559 "YoungFreeCSet",
560 "NonYoungFreeCSet"
561 //GCParPhasesSentinel only used to tell end of enum
562 };
|