< prev index next >

src/share/vm/gc/g1/concurrentMarkThread.cpp

Print this page




  93 }
  94 
  95 void ConcurrentMarkThread::run() {
  96   initialize_in_thread();
  97   _vtime_start = os::elapsedVTime();
  98   wait_for_universe_init();
  99 
 100   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 101   G1CollectorPolicy* g1_policy = g1h->g1_policy();
 102   G1MMUTracker *mmu_tracker = g1_policy->mmu_tracker();
 103   Thread *current_thread = Thread::current();
 104 
 105   while (!_should_terminate) {
 106     // wait until started is set.
 107     sleepBeforeNextCycle();
 108     if (_should_terminate) {
 109       break;
 110     }
 111 
 112     GCIdMark gc_id_mark;

 113     {
 114       ResourceMark rm;
 115       HandleMark   hm;
 116       double cycle_start = os::elapsedVTime();
 117 
 118       // We have to ensure that we finish scanning the root regions
 119       // before the next GC takes place. To ensure this we have to
 120       // make sure that we do not join the STS until the root regions
 121       // have been scanned. If we did then it's possible that a
 122       // subsequent GC could block us from joining the STS and proceed
 123       // without the root regions have been scanned which would be a
 124       // correctness issue.
 125 
 126       if (!cm()->has_aborted()) {
 127         _cm->scanRootRegions();
 128       }
 129 
 130       double mark_start_sec = os::elapsedTime();
 131       cm_log(G1Log::fine(), true, "[GC concurrent-mark-start]");
 132 




  93 }
  94 
  95 void ConcurrentMarkThread::run() {
  96   initialize_in_thread();
  97   _vtime_start = os::elapsedVTime();
  98   wait_for_universe_init();
  99 
 100   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 101   G1CollectorPolicy* g1_policy = g1h->g1_policy();
 102   G1MMUTracker *mmu_tracker = g1_policy->mmu_tracker();
 103   Thread *current_thread = Thread::current();
 104 
 105   while (!_should_terminate) {
 106     // wait until started is set.
 107     sleepBeforeNextCycle();
 108     if (_should_terminate) {
 109       break;
 110     }
 111 
 112     GCIdMark gc_id_mark;
 113 
 114     {
 115       ResourceMark rm;
 116       HandleMark   hm;
 117       double cycle_start = os::elapsedVTime();
 118 
 119       // We have to ensure that we finish scanning the root regions
 120       // before the next GC takes place. To ensure this we have to
 121       // make sure that we do not join the STS until the root regions
 122       // have been scanned. If we did then it's possible that a
 123       // subsequent GC could block us from joining the STS and proceed
 124       // without the root regions have been scanned which would be a
 125       // correctness issue.
 126 
 127       if (!cm()->has_aborted()) {
 128         _cm->scanRootRegions();
 129       }
 130 
 131       double mark_start_sec = os::elapsedTime();
 132       cm_log(G1Log::fine(), true, "[GC concurrent-mark-start]");
 133 


< prev index next >