src/share/vm/runtime/arguments.cpp

Print this page
rev 7141 : [mq]: 8059527
rev 7142 : [mq]: review

@@ -1688,15 +1688,14 @@
 void Arguments::set_g1_gc_flags() {
   assert(UseG1GC, "Error");
 #ifdef COMPILER1
   FastTLABRefill = false;
 #endif
-  FLAG_SET_DEFAULT(ParallelGCThreads,
-                     Abstract_VM_Version::parallel_worker_threads());
+  FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
   if (ParallelGCThreads == 0) {
-    FLAG_SET_DEFAULT(ParallelGCThreads,
-                     Abstract_VM_Version::parallel_worker_threads());
+    assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
+    vm_exit_during_initialization("The G1 GC can not be combined with -XX:ParallelGCThreads=0", NULL);
   }
 
 #if INCLUDE_ALL_GCS
   if (G1ConcRefinementThreads == 0) {
     FLAG_SET_DEFAULT(G1ConcRefinementThreads, ParallelGCThreads);