--- old/src/share/vm/gc/g1/g1ConcurrentMark.cpp 2016-06-23 12:33:40.307511310 -0700 +++ new/src/share/vm/gc/g1/g1ConcurrentMark.cpp 2016-06-23 12:33:40.207511314 -0700 @@ -1033,11 +1033,14 @@ uint active_workers = MAX2(1U, parallel_marking_threads()); assert(active_workers > 0, "Should have been set"); + // Setting active workers is not guaranteed since fewer + // worker threads may currently exist and more may not be + // available. + active_workers = _parallel_workers->update_active_workers(active_workers); // Parallel task terminator is set in "set_concurrency_and_phase()" set_concurrency_and_phase(active_workers, true /* concurrent */); G1CMConcurrentMarkingTask markingTask(this, cmThread()); - _parallel_workers->set_active_workers(active_workers); _parallel_workers->run_task(&markingTask); print_stats(); }