1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed Mar 16 10:37:08 2011 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Mar 17 10:32:46 2011 -0700 1.3 @@ -2141,21 +2141,22 @@ 1.4 G1CMKeepAliveClosure g1_keep_alive(g1h, this, nextMarkBitMap()); 1.5 G1CMDrainMarkingStackClosure 1.6 g1_drain_mark_stack(nextMarkBitMap(), &_markStack, &g1_keep_alive); 1.7 - 1.8 // We use the work gang from the G1CollectedHeap and we utilize all 1.9 // the worker threads. 1.10 - int active_workers = MAX2(MIN2(g1h->workers()->total_workers(), (int)_max_task_num), 1); 1.11 + int active_workers = g1h->workers() ? g1h->workers()->total_workers() : 1; 1.12 + active_workers = MAX2(MIN2(active_workers, (int)_max_task_num), 1); 1.13 1.14 G1RefProcTaskExecutor par_task_executor(g1h, this, nextMarkBitMap(), 1.15 g1h->workers(), active_workers); 1.16 1.17 + 1.18 if (rp->processing_is_mt()) { 1.19 // Set the degree of MT here. If the discovery is done MT, there 1.20 // may have been a different number of threads doing the discovery 1.21 // and a different number of discovered lists may have Ref objects. 1.22 // That is OK as long as the Reference lists are balanced (see 1.23 // balance_all_queues() and balance_queues()). 1.24 - rp->set_mt_degree(active_workers); 1.25 + rp->set_active_mt_degree(active_workers); 1.26 1.27 rp->process_discovered_references(&g1_is_alive, 1.28 &g1_keep_alive,