Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
          +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
↓ open down ↓ 3315 lines elided ↑ open up ↑
3316 3316          _cm->drainAllSATBBuffers();
3317 3317          double finish_mark_ms = (os::elapsedTime() - start_time_sec) * 1000.0;
3318 3318          g1_policy()->record_satb_drain_time(finish_mark_ms);
3319 3319        }
3320 3320        // Record the number of elements currently on the mark stack, so we
3321 3321        // only iterate over these.  (Since evacuation may add to the mark
3322 3322        // stack, doing more exposes race conditions.)  If no mark is in
3323 3323        // progress, this will be zero.
3324 3324        _cm->set_oops_do_bound();
3325 3325  
3326      -      if (mark_in_progress())
     3326 +      if (mark_in_progress()) {
3327 3327          concurrent_mark()->newCSet();
     3328 +      }
3328 3329  
3329 3330  #if YOUNG_LIST_VERBOSE
3330 3331        gclog_or_tty->print_cr("\nBefore choosing collection set.\nYoung_list:");
3331 3332        _young_list->print();
3332 3333        g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
3333 3334  #endif // YOUNG_LIST_VERBOSE
3334 3335  
3335 3336        g1_policy()->choose_collection_set(target_pause_time_ms);
3336 3337  
     3338 +      // We have chosen the complete collection set. If marking is
     3339 +      // active then, we clear the region fields of any of the
     3340 +      // concurrent marking tasks whose region fields point into
     3341 +      // the collection set as these values will become stale. This
     3342 +      // will cause the owning marking threads to claim a new region
     3343 +      // when marking restarts.
     3344 +      if (mark_in_progress()) {
     3345 +        concurrent_mark()->reset_active_task_region_fields_in_cset();
     3346 +      }
     3347 +
3337 3348        // Nothing to do if we were unable to choose a collection set.
3338 3349  #if G1_REM_SET_LOGGING
3339 3350        gclog_or_tty->print_cr("\nAfter pause, heap:");
3340 3351        print();
3341 3352  #endif
3342 3353        PrepareForRSScanningClosure prepare_for_rs_scan;
3343 3354        collection_set_iterate(&prepare_for_rs_scan);
3344 3355  
3345 3356        setup_surviving_young_words();
3346 3357  
↓ open down ↓ 2164 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX