< prev index next >

src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java

Print this page

        

@@ -184,25 +184,28 @@
                 set_live = true;
                 liveopt = "-live";
             } else if (subopt.startsWith("file=")) {
                 filename = parseFileName(subopt);
                 if (filename == null) {
+                    System.err.println("Fail at processing option '" + subopt +"'");
                     usage(1); // invalid options or no filename
                 }
             } else if (subopt.startsWith("parallel=")) {
                parallel = subopt.substring("parallel=".length());
                if (parallel == null) {
+                    System.err.println("Fail at processing option '" + subopt + "'");
                     usage(1);
                }
             } else {
+                System.err.println("Fail at processing option '" + subopt + "'");
                 usage(1);
             }
         }
+        // backward compitable: if both "live" and "all" set, use "live".
         if (set_live && set_all) {
-            usage(1);
+           liveopt = "-live";
         }
-
         System.out.flush();
         // inspectHeap is not the same as jcmd GC.class_histogram
         executeCommandForPid(pid, "inspectheap", liveopt, filename, parallel);
     }
 

@@ -222,10 +225,11 @@
                 filename = parseFileName(subopt);
             }
         }
 
         if (filename == null) {
+            System.err.println("Fail at processing option 'file'");
             usage(1);  // invalid options or no filename
         }
 
         // dumpHeap is not the same as jcmd GC.heap_dump
         executeCommandForPid(pid, "dumpheap", filename, liveopt);
< prev index next >