提交 fa74550e 编写于 作者: B brutisso

8005489: VM hangs during GC with ParallelGC and ParallelGCThreads=0

Summary: Print an error message and exit the VM if UseParallalGC is combined with ParllelGCThreads==0. Also reviewed by vitalyd@gmail.com.
Reviewed-by: stefank, ehelin
上级 586a7855
...@@ -1454,30 +1454,34 @@ void Arguments::set_parallel_gc_flags() { ...@@ -1454,30 +1454,34 @@ void Arguments::set_parallel_gc_flags() {
// If no heap maximum was requested explicitly, use some reasonable fraction // If no heap maximum was requested explicitly, use some reasonable fraction
// of the physical memory, up to a maximum of 1GB. // of the physical memory, up to a maximum of 1GB.
if (UseParallelGC) { FLAG_SET_DEFAULT(ParallelGCThreads,
FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
Abstract_VM_Version::parallel_worker_threads()); if (ParallelGCThreads == 0) {
jio_fprintf(defaultStream::error_stream(),
"The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
vm_exit(1);
}
// If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
// SurvivorRatio has been set, reset their default values to SurvivorRatio + // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
// 2. By doing this we make SurvivorRatio also work for Parallel Scavenger. // SurvivorRatio has been set, reset their default values to SurvivorRatio +
// See CR 6362902 for details. // 2. By doing this we make SurvivorRatio also work for Parallel Scavenger.
if (!FLAG_IS_DEFAULT(SurvivorRatio)) { // See CR 6362902 for details.
if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) { if (!FLAG_IS_DEFAULT(SurvivorRatio)) {
FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2); if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) {
} FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2);
if (FLAG_IS_DEFAULT(MinSurvivorRatio)) { }
FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2); if (FLAG_IS_DEFAULT(MinSurvivorRatio)) {
} FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2);
} }
}
if (UseParallelOldGC) { if (UseParallelOldGC) {
// Par compact uses lower default values since they are treated as // Par compact uses lower default values since they are treated as
// minimums. These are different defaults because of the different // minimums. These are different defaults because of the different
// interpretation and are not ergonomically set. // interpretation and are not ergonomically set.
if (FLAG_IS_DEFAULT(MarkSweepDeadRatio)) { if (FLAG_IS_DEFAULT(MarkSweepDeadRatio)) {
FLAG_SET_DEFAULT(MarkSweepDeadRatio, 1); FLAG_SET_DEFAULT(MarkSweepDeadRatio, 1);
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册