United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6872136 CMS: confusing message may be printed when a collector is switched off implicitly
6872136 : CMS: confusing message may be printed when a collector is switched off implicitly

Details
Type:
Bug
Submit Date:
2009-08-14
Status:
Closed
Updated Date:
2012-02-01
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs17

Related Reports
Backport:
Backport:

Sub Tasks

Description
Confusing message may be printed when collector is switched implicitly. 
For example, when CDS is enabled, CMS will be switched off. 

$ java -client -Xmixed -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -Xshare:dump
error: ??invalid argument combination.
The CMS collector (-XX:+UseConcMarkSweepGC) must be selected in order
to use CMSIncrementalMode.
Could not create the Java virtual machine.
VM option '+UseConcMarkSweepGC'
VM option '+CMSIncrementalMode'

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/68ef3fdcdb76
                                     
2009-09-25
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/68ef3fdcdb76
                                     
2009-09-11
SUGGESTED FIX

The final form of the fix was somewhat different, please use
the diffs from the Mercurial changeset pointer in the Evaluation
section:-

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/68ef3fdcdb76
                                     
2009-09-11
SUGGESTED FIX

--- a/src/share/vm/runtime/arguments.cpp        Wed Sep 02 00:04:29 2009 -0700
+++ b/src/share/vm/runtime/arguments.cpp        Tue Sep 08 11:08:18 2009 -0700
@@ -1582,9 +1582,15 @@ bool Arguments::check_vm_args_consistenc
     // 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 {
+      jio_fprintf(defaultStream::error_stream(),
+                  "Turning off use of shared archive because of "
+                  "choice of garbage collector or large pages \n");
       no_shared_spaces();
     }
   }
@@ -1609,7 +1615,7 @@ bool Arguments::check_vm_args_consistenc
   }
 
   if (CMSIncrementalMode) {
-    if (!UseConcMarkSweepGC) {
+    if (!(UseConcMarkSweepGC || DumpSharedSpaces || ForceSharedSpaces)) {
       jio_fprintf(defaultStream::error_stream(),
                   "error:  invalid argument combination.\n"
                   "The CMS collector (-XX:+UseConcMarkSweepGC) must be "
                                     
2009-09-08
EVALUATION

If the CL option combination is forcing CDS, then switch off the CMSIncrementalMode/UseConcMarkSweepGC consistency check. Clarify JVM options switched off implicitly as a result of "conflicting choices" related to GC's and class data sharing.
                                     
2009-09-08



Hardware and Software, Engineered to Work Together