--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-12-09 03:18:55.430483463 -0500 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-12-09 03:18:55.058463762 -0500 @@ -1529,10 +1529,6 @@ _is_subject_to_discovery_cm(this), _in_cset_fast_test() { - _workers = new WorkGang("GC Thread", ParallelGCThreads, - true /* are_GC_task_threads */, - false /* are_ConcurrentGC_threads */); - _workers->initialize_workers(); _verifier = new G1HeapVerifier(this); _allocator = new G1Allocator(this); @@ -1765,6 +1761,14 @@ _humongous_reclaim_candidates.initialize(start, end, granularity); } + _workers = new WorkGang("GC Thread", ParallelGCThreads, + true /* are_GC_task_threads */, + false /* are_ConcurrentGC_threads */); + if (_workers == NULL) { + return JNI_ENOMEM; + } + _workers->initialize_workers(); + // Create the G1ConcurrentMark data structure and thread. // (Must do this late, so that "max_regions" is defined.) _cm = new G1ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage);