92 GCTraceTime(Info, gc) time("Concurrent marking", gc_timer, GCCause::_no_gc, true);
93 TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters());
94 ShenandoahHeap::heap()->concurrentMark()->mark_from_roots();
95 }
96
97 {
98 TraceCollectorStats tcs(heap->monitoring_support()->stw_collection_counters());
99 VM_ShenandoahStartEvacuation finishMark;
100 heap->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::final_mark_gross);
101 VMThread::execute(&finishMark);
102 heap->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::final_mark_gross);
103 }
104
105 if (! should_terminate()) {
106 GCTraceTime(Info, gc) time("Concurrent evacuation ", gc_timer, GCCause::_no_gc, true);
107 TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters());
108 heap->do_evacuation();
109 }
110
111 if (heap->is_evacuation_in_progress()) {
112 heap->set_evacuation_in_progress(false);
113 }
114 heap->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::reset_bitmaps);
115 heap->reset_mark_bitmap();
116 heap->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::reset_bitmaps);
117
118 gc_timer->register_gc_end();
119 } else {
120 Thread::current()->_ParkEvent->park(10) ;
121 // yield();
122 }
123
124 // Make sure the _do_full_gc flag changes are seen.
125 OrderAccess::storeload();
126 }
127 }
128
129 void ShenandoahConcurrentThread::stop_service() {
130 // Nothing to do here.
131 }
|
92 GCTraceTime(Info, gc) time("Concurrent marking", gc_timer, GCCause::_no_gc, true);
93 TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters());
94 ShenandoahHeap::heap()->concurrentMark()->mark_from_roots();
95 }
96
97 {
98 TraceCollectorStats tcs(heap->monitoring_support()->stw_collection_counters());
99 VM_ShenandoahStartEvacuation finishMark;
100 heap->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::final_mark_gross);
101 VMThread::execute(&finishMark);
102 heap->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::final_mark_gross);
103 }
104
105 if (! should_terminate()) {
106 GCTraceTime(Info, gc) time("Concurrent evacuation ", gc_timer, GCCause::_no_gc, true);
107 TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters());
108 heap->do_evacuation();
109 }
110
111 if (heap->is_evacuation_in_progress()) {
112 MutexLocker mu(Threads_lock);
113 heap->set_evacuation_in_progress(false);
114 }
115 heap->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::reset_bitmaps);
116 heap->reset_mark_bitmap();
117 heap->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::reset_bitmaps);
118
119 gc_timer->register_gc_end();
120 } else {
121 Thread::current()->_ParkEvent->park(10) ;
122 // yield();
123 }
124
125 // Make sure the _do_full_gc flag changes are seen.
126 OrderAccess::storeload();
127 }
128 }
129
130 void ShenandoahConcurrentThread::stop_service() {
131 // Nothing to do here.
132 }
|