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 if (heap->mode()->is_generational()) {
141 ShenandoahGenerationalFullGC::prepare();
142 }
143
144 if (ShenandoahVerify) {
145 heap->verifier()->verify_before_fullgc(_generation);
146 }
147
148 if (VerifyBeforeGC) {
149 Universe::verify();
150 }
|
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 if (ShenandoahGCStateCheckHotpatch) {
133 // Leaving full GC, we need to flip barriers back to idle.
134 ShenandoahCodeRoots::arm_nmethods();
135 ShenandoahStackWatermark::change_epoch_id();
136 }
137
138 {
139 ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::full_gc_propagate_gc_state);
140 heap->propagate_gc_state_to_all_threads();
141 }
142 }
143
144 void ShenandoahFullGC::do_it(GCCause::Cause gc_cause) {
145 ShenandoahHeap* heap = ShenandoahHeap::heap();
146
147 if (heap->mode()->is_generational()) {
148 ShenandoahGenerationalFullGC::prepare();
149 }
150
151 if (ShenandoahVerify) {
152 heap->verifier()->verify_before_fullgc(_generation);
153 }
154
155 if (VerifyBeforeGC) {
156 Universe::verify();
157 }
|