< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java
Print this page
*** 71,80 ****
--- 71,81 ----
// --finalizerinfo -> -finalizerinfo
System.out.println(" <no option>\tto print same info as Solaris pmap");
System.out.println(" --heap\tto print java heap summary");
System.out.println(" --binaryheap\tto dump java heap in hprof binary format");
+ System.out.println(" --dumpfile\tname of the dump file");
System.out.println(" --histo\tto print histogram of java object heap");
System.out.println(" --clstats\tto print class loader statistics");
System.out.println(" --finalizerinfo\tto print information on objects awaiting finalization");
return commonHelp();
}
*** 239,255 ****
}
private static void runJMAP(String[] oldArgs) {
SAGetopt sg = new SAGetopt(oldArgs);
String[] longOpts = {"exe=", "core=", "pid=",
! "heap", "binaryheap", "histo", "clstats", "finalizerinfo"};
ArrayList<String> newArgs = new ArrayList();
String pid = null;
String exe = null;
String core = null;
String s = null;
while((s = sg.next(null, longOpts)) != null) {
if (s.equals("exe")) {
exe = sg.getOptarg();
continue;
--- 240,258 ----
}
private static void runJMAP(String[] oldArgs) {
SAGetopt sg = new SAGetopt(oldArgs);
String[] longOpts = {"exe=", "core=", "pid=",
! "heap", "binaryheap", "dumpfile=", "histo", "clstats", "finalizerinfo"};
ArrayList<String> newArgs = new ArrayList();
String pid = null;
String exe = null;
String core = null;
String s = null;
+ String dumpfile = null;
+ boolean requestHeapdump = false;
while((s = sg.next(null, longOpts)) != null) {
if (s.equals("exe")) {
exe = sg.getOptarg();
continue;
*** 265,275 ****
if (s.equals("heap")) {
newArgs.add("-heap");
continue;
}
if (s.equals("binaryheap")) {
! newArgs.add("-heap:format=b");
continue;
}
if (s.equals("histo")) {
newArgs.add("-histo");
continue;
--- 268,282 ----
if (s.equals("heap")) {
newArgs.add("-heap");
continue;
}
if (s.equals("binaryheap")) {
! requestHeapdump = true;
! continue;
! }
! if (s.equals("dumpfile")) {
! dumpfile = sg.getOptarg();
continue;
}
if (s.equals("histo")) {
newArgs.add("-histo");
continue;
*** 282,291 ****
--- 289,308 ----
newArgs.add("-finalizerinfo");
continue;
}
}
+ if (requestHeapdump) {
+ if (dumpfile == null) {
+ newArgs.add("-heap:format=b");
+ } else {
+ newArgs.add("-heap:format=b,file=" + dumpfile);
+ }
+ } else if (dumpfile != null) {
+ throw new IllegalArgumentException("dumpfile does not need.");
+ }
+
buildAttachArgs(newArgs, pid, exe, core, false);
JMap.main(newArgs.toArray(new String[newArgs.size()]));
}
private static void runJINFO(String[] oldArgs) {
< prev index next >