< prev index next >

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

Print this page
rev 11459 : create_thread_failed: fix errors from thread creation failures
rev 11460 : refactor: switch to update_active_threads()


1016 }
1017 
1018 void G1ConcurrentMark::mark_from_roots() {
1019   // we might be tempted to assert that:
1020   // assert(asynch == !SafepointSynchronize::is_at_safepoint(),
1021   //        "inconsistent argument?");
1022   // However that wouldn't be right, because it's possible that
1023   // a safepoint is indeed in progress as a younger generation
1024   // stop-the-world GC happens even as we mark in this generation.
1025 
1026   _restart_for_overflow = false;
1027 
1028   // _g1h has _n_par_threads
1029   _parallel_marking_threads = calc_parallel_marking_threads();
1030   assert(parallel_marking_threads() <= max_parallel_marking_threads(),
1031     "Maximum number of marking threads exceeded");
1032 
1033   uint active_workers = MAX2(1U, parallel_marking_threads());
1034   assert(active_workers > 0, "Should have been set");
1035 




1036   // Parallel task terminator is set in "set_concurrency_and_phase()"
1037   set_concurrency_and_phase(active_workers, true /* concurrent */);
1038 
1039   G1CMConcurrentMarkingTask markingTask(this, cmThread());
1040   _parallel_workers->set_active_workers(active_workers);
1041   _parallel_workers->run_task(&markingTask);
1042   print_stats();
1043 }
1044 
1045 void G1ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
1046   // world is stopped at this checkpoint
1047   assert(SafepointSynchronize::is_at_safepoint(),
1048          "world should be stopped");
1049 
1050   G1CollectedHeap* g1h = G1CollectedHeap::heap();
1051 
1052   // If a full collection has happened, we shouldn't do this.
1053   if (has_aborted()) {
1054     g1h->collector_state()->set_mark_in_progress(false); // So bitmap clearing isn't confused
1055     return;
1056   }
1057 
1058   SvcGCMarker sgcm(SvcGCMarker::OTHER);
1059 
1060   if (VerifyDuringGC) {




1016 }
1017 
1018 void G1ConcurrentMark::mark_from_roots() {
1019   // we might be tempted to assert that:
1020   // assert(asynch == !SafepointSynchronize::is_at_safepoint(),
1021   //        "inconsistent argument?");
1022   // However that wouldn't be right, because it's possible that
1023   // a safepoint is indeed in progress as a younger generation
1024   // stop-the-world GC happens even as we mark in this generation.
1025 
1026   _restart_for_overflow = false;
1027 
1028   // _g1h has _n_par_threads
1029   _parallel_marking_threads = calc_parallel_marking_threads();
1030   assert(parallel_marking_threads() <= max_parallel_marking_threads(),
1031     "Maximum number of marking threads exceeded");
1032 
1033   uint active_workers = MAX2(1U, parallel_marking_threads());
1034   assert(active_workers > 0, "Should have been set");
1035 
1036   // Setting active workers is not guaranteed since fewer
1037   // worker threads may currently exist and more may not be
1038   // available.
1039   active_workers = _parallel_workers->update_active_workers(active_workers);
1040   // Parallel task terminator is set in "set_concurrency_and_phase()"
1041   set_concurrency_and_phase(active_workers, true /* concurrent */);
1042 
1043   G1CMConcurrentMarkingTask markingTask(this, cmThread());

1044   _parallel_workers->run_task(&markingTask);
1045   print_stats();
1046 }
1047 
1048 void G1ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
1049   // world is stopped at this checkpoint
1050   assert(SafepointSynchronize::is_at_safepoint(),
1051          "world should be stopped");
1052 
1053   G1CollectedHeap* g1h = G1CollectedHeap::heap();
1054 
1055   // If a full collection has happened, we shouldn't do this.
1056   if (has_aborted()) {
1057     g1h->collector_state()->set_mark_in_progress(false); // So bitmap clearing isn't confused
1058     return;
1059   }
1060 
1061   SvcGCMarker sgcm(SvcGCMarker::OTHER);
1062 
1063   if (VerifyDuringGC) {


< prev index next >