35 #include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
36 #include "gc/shenandoah/shenandoahClosures.inline.hpp"
37 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
38 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
39 #include "gc/shenandoah/shenandoahConcurrentGC.hpp"
40 #include "gc/shenandoah/shenandoahFreeSet.hpp"
41 #include "gc/shenandoah/shenandoahFullGC.hpp"
42 #include "gc/shenandoah/shenandoahGenerationalFullGC.hpp"
43 #include "gc/shenandoah/shenandoahGlobalGeneration.hpp"
44 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
45 #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
46 #include "gc/shenandoah/shenandoahHeapRegionClosures.hpp"
47 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
48 #include "gc/shenandoah/shenandoahMark.inline.hpp"
49 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
50 #include "gc/shenandoah/shenandoahMetrics.hpp"
51 #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
52 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
53 #include "gc/shenandoah/shenandoahReferenceProcessor.hpp"
54 #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
55 #include "gc/shenandoah/shenandoahSTWMark.hpp"
56 #include "gc/shenandoah/shenandoahUtils.hpp"
57 #include "gc/shenandoah/shenandoahVerifier.hpp"
58 #include "gc/shenandoah/shenandoahVMOperations.hpp"
59 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
60 #include "memory/metaspaceUtils.hpp"
61 #include "memory/universe.hpp"
62 #include "oops/compressedOops.inline.hpp"
63 #include "oops/oop.inline.hpp"
64 #include "runtime/orderAccess.hpp"
65 #include "runtime/vmThread.hpp"
66 #include "utilities/copy.hpp"
67 #include "utilities/events.hpp"
68 #include "utilities/growableArray.hpp"
69
70 ShenandoahFullGC::ShenandoahFullGC() :
71 ShenandoahGC(ShenandoahHeap::heap()->global_generation()),
72 _gc_timer(ShenandoahHeap::heap()->gc_timer()),
73 _preserved_marks(new PreservedMarksSet(true)) {}
74
111
112 // Perform full GC
113 do_it(cause);
114
115 if (heap->mode()->is_generational()) {
116 ShenandoahGenerationalFullGC::handle_completion(heap);
117 }
118
119 if (metrics.is_good_progress()) {
120 heap->notify_gc_progress();
121 } else {
122 // Nothing to do. Tell the allocation path that we have failed to make
123 // progress, and it can finally fail.
124 heap->notify_gc_no_progress();
125 }
126
127 // Regardless if progress was made, we record that we completed a "successful" full GC.
128 _generation->heuristics()->record_success_full();
129 heap->shenandoah_policy()->record_success_full();
130
131 {
132 ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::full_gc_propagate_gc_state);
133 heap->propagate_gc_state_to_all_threads();
134 }
135 }
136
137 void ShenandoahFullGC::do_it(GCCause::Cause gc_cause) {
138 ShenandoahHeap* heap = ShenandoahHeap::heap();
139
140 // A full GC may be entered directly, or as an upgrade from a failed
141 // degenerated GC. In the latter case, self-forwarded objects may be
142 // present from the failed evacuation. Drain those marks before any phase
143 // (verify, update_roots, phase1_mark_heap) walks headers.
144 {
145 ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc_un_self_forward);
146 heap->un_self_forward_cset_regions();
147 }
148
149 if (heap->mode()->is_generational()) {
150 ShenandoahGenerationalFullGC::prepare();
|
35 #include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
36 #include "gc/shenandoah/shenandoahClosures.inline.hpp"
37 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
38 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
39 #include "gc/shenandoah/shenandoahConcurrentGC.hpp"
40 #include "gc/shenandoah/shenandoahFreeSet.hpp"
41 #include "gc/shenandoah/shenandoahFullGC.hpp"
42 #include "gc/shenandoah/shenandoahGenerationalFullGC.hpp"
43 #include "gc/shenandoah/shenandoahGlobalGeneration.hpp"
44 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
45 #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
46 #include "gc/shenandoah/shenandoahHeapRegionClosures.hpp"
47 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
48 #include "gc/shenandoah/shenandoahMark.inline.hpp"
49 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
50 #include "gc/shenandoah/shenandoahMetrics.hpp"
51 #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
52 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
53 #include "gc/shenandoah/shenandoahReferenceProcessor.hpp"
54 #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
55 #include "gc/shenandoah/shenandoahStackWatermark.hpp"
56 #include "gc/shenandoah/shenandoahSTWMark.hpp"
57 #include "gc/shenandoah/shenandoahUtils.hpp"
58 #include "gc/shenandoah/shenandoahVerifier.hpp"
59 #include "gc/shenandoah/shenandoahVMOperations.hpp"
60 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
61 #include "memory/metaspaceUtils.hpp"
62 #include "memory/universe.hpp"
63 #include "oops/compressedOops.inline.hpp"
64 #include "oops/oop.inline.hpp"
65 #include "runtime/orderAccess.hpp"
66 #include "runtime/vmThread.hpp"
67 #include "utilities/copy.hpp"
68 #include "utilities/events.hpp"
69 #include "utilities/growableArray.hpp"
70
71 ShenandoahFullGC::ShenandoahFullGC() :
72 ShenandoahGC(ShenandoahHeap::heap()->global_generation()),
73 _gc_timer(ShenandoahHeap::heap()->gc_timer()),
74 _preserved_marks(new PreservedMarksSet(true)) {}
75
112
113 // Perform full GC
114 do_it(cause);
115
116 if (heap->mode()->is_generational()) {
117 ShenandoahGenerationalFullGC::handle_completion(heap);
118 }
119
120 if (metrics.is_good_progress()) {
121 heap->notify_gc_progress();
122 } else {
123 // Nothing to do. Tell the allocation path that we have failed to make
124 // progress, and it can finally fail.
125 heap->notify_gc_no_progress();
126 }
127
128 // Regardless if progress was made, we record that we completed a "successful" full GC.
129 _generation->heuristics()->record_success_full();
130 heap->shenandoah_policy()->record_success_full();
131
132 // Leaving full GC, we need to flip barriers back to idle.
133 ShenandoahCodeRoots::arm_nmethods();
134 ShenandoahCodeRoots::disarm_nmethods();
135
136 {
137 ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::full_gc_propagate_gc_state);
138 heap->propagate_gc_state_to_all_threads();
139 }
140 }
141
142 void ShenandoahFullGC::do_it(GCCause::Cause gc_cause) {
143 ShenandoahHeap* heap = ShenandoahHeap::heap();
144
145 // A full GC may be entered directly, or as an upgrade from a failed
146 // degenerated GC. In the latter case, self-forwarded objects may be
147 // present from the failed evacuation. Drain those marks before any phase
148 // (verify, update_roots, phase1_mark_heap) walks headers.
149 {
150 ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc_un_self_forward);
151 heap->un_self_forward_cset_regions();
152 }
153
154 if (heap->mode()->is_generational()) {
155 ShenandoahGenerationalFullGC::prepare();
|