249 gclog_or_tty->print_cr("[GC concurrent-cleanup-start]"); |
249 gclog_or_tty->print_cr("[GC concurrent-cleanup-start]"); |
250 } |
250 } |
251 |
251 |
252 // Now do the remainder of the cleanup operation. |
252 // Now do the remainder of the cleanup operation. |
253 _cm->completeCleanup(); |
253 _cm->completeCleanup(); |
|
254 // Notify anyone who's waiting that there are no more free |
|
255 // regions coming. We have to do this before we join the STS, |
|
256 // otherwise we might deadlock: a GC worker could be blocked |
|
257 // waiting for the notification whereas this thread will be |
|
258 // blocked for the pause to finish while it's trying to join |
|
259 // the STS, which is conditional on the GC workers finishing. |
|
260 g1h->reset_free_regions_coming(); |
|
261 |
254 _sts.join(); |
262 _sts.join(); |
255 g1_policy->record_concurrent_mark_cleanup_completed(); |
263 g1_policy->record_concurrent_mark_cleanup_completed(); |
256 _sts.leave(); |
264 _sts.leave(); |
257 |
265 |
258 double cleanup_end_sec = os::elapsedTime(); |
266 double cleanup_end_sec = os::elapsedTime(); |
260 gclog_or_tty->date_stamp(PrintGCDateStamps); |
268 gclog_or_tty->date_stamp(PrintGCDateStamps); |
261 gclog_or_tty->stamp(PrintGCTimeStamps); |
269 gclog_or_tty->stamp(PrintGCTimeStamps); |
262 gclog_or_tty->print_cr("[GC concurrent-cleanup-end, %1.7lf]", |
270 gclog_or_tty->print_cr("[GC concurrent-cleanup-end, %1.7lf]", |
263 cleanup_end_sec - cleanup_start_sec); |
271 cleanup_end_sec - cleanup_start_sec); |
264 } |
272 } |
265 |
|
266 // We're done: no more free regions coming. |
|
267 g1h->reset_free_regions_coming(); |
|
268 } |
273 } |
269 guarantee(cm()->cleanup_list_is_empty(), |
274 guarantee(cm()->cleanup_list_is_empty(), |
270 "at this point there should be no regions on the cleanup list"); |
275 "at this point there should be no regions on the cleanup list"); |
271 |
276 |
272 if (cm()->has_aborted()) { |
277 if (cm()->has_aborted()) { |