--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Tue Dec 11 13:13:18 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Tue Dec 11 18:00:17 2018 -0500
@@ -1531,10 +1531,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);
@@ -1767,6 +1763,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);