< prev index next >

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

Print this page




 172           log_info(gc, marking)("Concurrent Mark (%.3fs, %.3fs) %.3fms",
 173                                 TimeHelper::counter_to_seconds(mark_start),
 174                                 TimeHelper::counter_to_seconds(mark_end),
 175                                 TimeHelper::counter_to_millis(mark_end - mark_start));
 176 
 177           CMCheckpointRootsFinalClosure final_cl(_cm);
 178           VM_CGC_Operation op(&final_cl, "Pause Remark", true /* needs_pll */);
 179           VMThread::execute(&op);
 180         }
 181         if (cm()->restart_for_overflow()) {
 182           log_debug(gc, marking)("Restarting Concurrent Marking because of Mark Stack Overflow in Remark (Iteration #%d).", iter);
 183           log_info(gc, marking)("Concurrent Mark Restart due to overflow");
 184         }
 185       } while (cm()->restart_for_overflow());
 186 
 187       if (!cm()->has_aborted()) {
 188         G1ConcPhaseTimer t(_cm, "Concurrent Create Live Data");
 189         cm()->create_live_data();
 190       }
 191 
 192       double end_time = os::elapsedVTime();
 193       // Update the total virtual time before doing this, since it will try
 194       // to measure it to get the vtime for this marking.  We purposely
 195       // neglect the presumably-short "completeCleanup" phase here.
 196       _vtime_accum = (end_time - _vtime_start);
 197 
 198       if (!cm()->has_aborted()) {
 199         delay_to_keep_mmu(g1_policy, false /* cleanup */);
 200 
 201         CMCleanUp cl_cl(_cm);
 202         VM_CGC_Operation op(&cl_cl, "Pause Cleanup", false /* needs_pll */);
 203         VMThread::execute(&op);




 204       } else {
 205         // We don't want to update the marking status if a GC pause
 206         // is already underway.
 207         SuspendibleThreadSetJoiner sts_join;
 208         g1h->collector_state()->set_mark_in_progress(false);
 209       }
 210 
 211       // Check if cleanup set the free_regions_coming flag. If it
 212       // hasn't, we can just skip the next step.
 213       if (g1h->free_regions_coming()) {
 214         // The following will finish freeing up any regions that we
 215         // found to be empty during cleanup. We'll do this part
 216         // without joining the suspendible set. If an evacuation pause
 217         // takes place, then we would carry on freeing regions in
 218         // case they are needed by the pause. If a Full GC takes
 219         // place, it would wait for us to process the regions
 220         // reclaimed by cleanup.
 221 
 222         G1ConcPhaseTimer t(_cm, "Concurrent Complete Cleanup");
 223         // Now do the concurrent cleanup operation.




 172           log_info(gc, marking)("Concurrent Mark (%.3fs, %.3fs) %.3fms",
 173                                 TimeHelper::counter_to_seconds(mark_start),
 174                                 TimeHelper::counter_to_seconds(mark_end),
 175                                 TimeHelper::counter_to_millis(mark_end - mark_start));
 176 
 177           CMCheckpointRootsFinalClosure final_cl(_cm);
 178           VM_CGC_Operation op(&final_cl, "Pause Remark", true /* needs_pll */);
 179           VMThread::execute(&op);
 180         }
 181         if (cm()->restart_for_overflow()) {
 182           log_debug(gc, marking)("Restarting Concurrent Marking because of Mark Stack Overflow in Remark (Iteration #%d).", iter);
 183           log_info(gc, marking)("Concurrent Mark Restart due to overflow");
 184         }
 185       } while (cm()->restart_for_overflow());
 186 
 187       if (!cm()->has_aborted()) {
 188         G1ConcPhaseTimer t(_cm, "Concurrent Create Live Data");
 189         cm()->create_live_data();
 190       }
 191 
 192       double remark_end_time = os::elapsedVTime();
 193       _vtime_accum = (remark_end_time - _vtime_start);



 194 
 195       if (!cm()->has_aborted()) {
 196         delay_to_keep_mmu(g1_policy, false /* cleanup */);
 197 
 198         CMCleanUp cl_cl(_cm);
 199         VM_CGC_Operation op(&cl_cl, "Pause Cleanup", false /* needs_pll */);
 200         VMThread::execute(&op);
 201 
 202         double cleanup_end_time = os::elapsedVTime();
 203         // Update the total virtual time for 'Pause Cleanup'.
 204         _vtime_accum += (cleanup_end_time - remark_end_time);
 205       } else {
 206         // We don't want to update the marking status if a GC pause
 207         // is already underway.
 208         SuspendibleThreadSetJoiner sts_join;
 209         g1h->collector_state()->set_mark_in_progress(false);
 210       }
 211 
 212       // Check if cleanup set the free_regions_coming flag. If it
 213       // hasn't, we can just skip the next step.
 214       if (g1h->free_regions_coming()) {
 215         // The following will finish freeing up any regions that we
 216         // found to be empty during cleanup. We'll do this part
 217         // without joining the suspendible set. If an evacuation pause
 218         // takes place, then we would carry on freeing regions in
 219         // case they are needed by the pause. If a Full GC takes
 220         // place, it would wait for us to process the regions
 221         // reclaimed by cleanup.
 222 
 223         G1ConcPhaseTimer t(_cm, "Concurrent Complete Cleanup");
 224         // Now do the concurrent cleanup operation.


< prev index next >