--- old/src/hotspot/share/utilities/globalCounter.cpp 2018-08-03 16:41:20.000000000 -0500 +++ new/src/hotspot/share/utilities/globalCounter.cpp 2018-08-03 16:41:20.000000000 -0500 @@ -61,6 +61,11 @@ // Atomic::add must provide fence since we have storeload dependency. volatile uintx gbl_cnt = Atomic::add((uintx)COUNTER_INCREMENT, &_global_counter._counter, memory_order_conservative); + // Handle bootstrap + if (Threads::number_of_threads() == 0) { + return; + } + // Do all RCU threads. CounterThreadCheck ctc(gbl_cnt); for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {