142 if (!cm()->has_aborted()) {
143 if (g1_policy->adaptive_young_list_length()) {
144 double now = os::elapsedTime();
145 double remark_prediction_ms = g1_policy->predict_remark_time_ms();
146 jlong sleep_time_ms = mmu_tracker->when_ms(now, remark_prediction_ms);
147 os::sleep(current_thread, sleep_time_ms, false);
148 }
149
150 if (G1Log::fine()) {
151 gclog_or_tty->date_stamp(PrintGCDateStamps);
152 gclog_or_tty->stamp(PrintGCTimeStamps);
153 gclog_or_tty->print_cr("[GC concurrent-mark-end, %1.7lf sec]",
154 mark_end_sec - mark_start_sec);
155 }
156
157 CMCheckpointRootsFinalClosure final_cl(_cm);
158 sprintf(verbose_str, "GC remark");
159 VM_CGC_Operation op(&final_cl, verbose_str, true /* needs_pll */);
160 VMThread::execute(&op);
161 }
162 if (cm()->restart_for_overflow() &&
163 G1TraceMarkStackOverflow) {
164 gclog_or_tty->print_cr("Restarting conc marking because of MS overflow "
165 "in remark (restart #%d).", iter);
166 }
167
168 if (cm()->restart_for_overflow()) {
169 if (G1Log::fine()) {
170 gclog_or_tty->date_stamp(PrintGCDateStamps);
171 gclog_or_tty->stamp(PrintGCTimeStamps);
172 gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
173 }
174 }
175 } while (cm()->restart_for_overflow());
176
177 double end_time = os::elapsedVTime();
178 // Update the total virtual time before doing this, since it will try
179 // to measure it to get the vtime for this marking. We purposely
180 // neglect the presumably-short "completeCleanup" phase here.
181 _vtime_accum = (end_time - _vtime_start);
182
183 if (!cm()->has_aborted()) {
184 if (g1_policy->adaptive_young_list_length()) {
185 double now = os::elapsedTime();
186 double cleanup_prediction_ms = g1_policy->predict_cleanup_time_ms();
187 jlong sleep_time_ms = mmu_tracker->when_ms(now, cleanup_prediction_ms);
188 os::sleep(current_thread, sleep_time_ms, false);
|
142 if (!cm()->has_aborted()) {
143 if (g1_policy->adaptive_young_list_length()) {
144 double now = os::elapsedTime();
145 double remark_prediction_ms = g1_policy->predict_remark_time_ms();
146 jlong sleep_time_ms = mmu_tracker->when_ms(now, remark_prediction_ms);
147 os::sleep(current_thread, sleep_time_ms, false);
148 }
149
150 if (G1Log::fine()) {
151 gclog_or_tty->date_stamp(PrintGCDateStamps);
152 gclog_or_tty->stamp(PrintGCTimeStamps);
153 gclog_or_tty->print_cr("[GC concurrent-mark-end, %1.7lf sec]",
154 mark_end_sec - mark_start_sec);
155 }
156
157 CMCheckpointRootsFinalClosure final_cl(_cm);
158 sprintf(verbose_str, "GC remark");
159 VM_CGC_Operation op(&final_cl, verbose_str, true /* needs_pll */);
160 VMThread::execute(&op);
161 }
162 if (cm()->restart_for_overflow()) {
163 if (G1TraceMarkStackOverflow) {
164 gclog_or_tty->print_cr("Restarting conc marking because of MS overflow "
165 "in remark (restart #%d).", iter);
166 }
167 if (G1Log::fine()) {
168 gclog_or_tty->date_stamp(PrintGCDateStamps);
169 gclog_or_tty->stamp(PrintGCTimeStamps);
170 gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
171 }
172 }
173 } while (cm()->restart_for_overflow());
174
175 double end_time = os::elapsedVTime();
176 // Update the total virtual time before doing this, since it will try
177 // to measure it to get the vtime for this marking. We purposely
178 // neglect the presumably-short "completeCleanup" phase here.
179 _vtime_accum = (end_time - _vtime_start);
180
181 if (!cm()->has_aborted()) {
182 if (g1_policy->adaptive_young_list_length()) {
183 double now = os::elapsedTime();
184 double cleanup_prediction_ms = g1_policy->predict_cleanup_time_ms();
185 jlong sleep_time_ms = mmu_tracker->when_ms(now, cleanup_prediction_ms);
186 os::sleep(current_thread, sleep_time_ms, false);
|