From 1c5e14f0b9fef5e27ff45b0d2ec39be68104520c Mon Sep 17 00:00:00 2001 From: ysr Date: Thu, 10 Sep 2009 16:46:17 -0700 Subject: [PATCH] 6872136: CMS: confusing message may be printed when a collector is switched off implicitly Summary: Fix CDS/CMS option overrides related to iCMS option CMSIncrementalMode; explicate overrides to error stream. Reviewed-by: coleenp --- src/share/vm/runtime/arguments.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 2cce45220..43bcbb361 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -1450,6 +1450,7 @@ static void set_serial_gc_flags() { FLAG_SET_DEFAULT(UseSerialGC, true); FLAG_SET_DEFAULT(UseParNewGC, false); FLAG_SET_DEFAULT(UseConcMarkSweepGC, false); + FLAG_SET_DEFAULT(CMSIncrementalMode, false); // special CMS suboption FLAG_SET_DEFAULT(UseParallelGC, false); FLAG_SET_DEFAULT(UseParallelOldGC, false); FLAG_SET_DEFAULT(UseG1GC, false); @@ -1457,7 +1458,7 @@ static void set_serial_gc_flags() { static bool verify_serial_gc_flags() { return (UseSerialGC && - !(UseParNewGC || UseConcMarkSweepGC || UseG1GC || + !(UseParNewGC || (UseConcMarkSweepGC || CMSIncrementalMode) || UseG1GC || UseParallelGC || UseParallelOldGC)); } @@ -1572,7 +1573,7 @@ bool Arguments::check_vm_args_consistency() { status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit"); // Check user specified sharing option conflict with Parallel GC - bool cannot_share = (UseConcMarkSweepGC || UseG1GC || UseParNewGC || + bool cannot_share = ((UseConcMarkSweepGC || CMSIncrementalMode) || UseG1GC || UseParNewGC || UseParallelGC || UseParallelOldGC || SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages)); @@ -1580,9 +1581,17 @@ bool Arguments::check_vm_args_consistency() { // Either force sharing on by forcing the other options off, or // force sharing off. if (DumpSharedSpaces || ForceSharedSpaces) { + jio_fprintf(defaultStream::error_stream(), + "Reverting to Serial GC because of %s \n", + ForceSharedSpaces ? " -Xshare:on" : "-Xshare:dump"); set_serial_gc_flags(); FLAG_SET_DEFAULT(SOLARIS_ONLY(UseISM) NOT_SOLARIS(UseLargePages), false); } else { + if (UseSharedSpaces) { + jio_fprintf(defaultStream::error_stream(), + "Turning off use of shared archive because of " + "choice of garbage collector or large pages \n"); + } no_shared_spaces(); } } -- GitLab