< prev index next >

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

Print this page

        

@@ -187,22 +187,23 @@
       if (!cm()->has_aborted()) {
         G1ConcPhaseTimer t(_cm, "Concurrent Create Live Data");
         cm()->create_live_data();
       }
 
-      double end_time = os::elapsedVTime();
-      // Update the total virtual time before doing this, since it will try
-      // to measure it to get the vtime for this marking.  We purposely
-      // neglect the presumably-short "completeCleanup" phase here.
-      _vtime_accum = (end_time - _vtime_start);
+      double remark_end_time = os::elapsedVTime();
+      _vtime_accum = (remark_end_time - _vtime_start);
 
       if (!cm()->has_aborted()) {
         delay_to_keep_mmu(g1_policy, false /* cleanup */);
 
         CMCleanUp cl_cl(_cm);
         VM_CGC_Operation op(&cl_cl, "Pause Cleanup", false /* needs_pll */);
         VMThread::execute(&op);
+
+        double cleanup_end_time = os::elapsedVTime();
+        // Update the total virtual time for 'Pause Cleanup'.
+        _vtime_accum += (cleanup_end_time - remark_end_time);
       } else {
         // We don't want to update the marking status if a GC pause
         // is already underway.
         SuspendibleThreadSetJoiner sts_join;
         g1h->collector_state()->set_mark_in_progress(false);
< prev index next >