查看进程号和 输出dump文件。刚开始一直报错

一直想生成这文件,刚开始一直报错:原因是我用的是;window的进程号。

报错如下:

Attaching to process ID 1508, please wait...
Error attaching to process: Doesn't appear to be a HotSpot VM (could not find symbol "gHotSpotVMTypes" in remote process)
sun.jvm.hotspot.debugger.DebuggerException: Doesn't appear to be a HotSpot VM (could not find symbol "gHotSpotVMTypes" in remote process)
        at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:411)
        at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305)
        at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at sun.tools.jmap.JMap.runTool(JMap.java:201)
        at sun.tools.jmap.JMap.main(JMap.java:130)


Error attaching to core file: Windbg Error: OpenDumpFile failed!
sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: OpenDumpFile failed!
        at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach0(Native Method)
        at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach(WindbgDebuggerLocal.java:160)
        at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:673)
        at sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(HotSpotAgent.java:569)
        at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:335)
        at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
        at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:156)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:191)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at sun.tools.jmap.JMap.runTool(JMap.java:201)
        at sun.tools.jmap.JMap.main(JMap.java:130)

E:\ruanjian\Java\jdk8\bin>jmap -histo [pid]
Attaching to remote server [pid], please wait...
Error attaching to remote server: java.net.MalformedURLException: invalid URL String: //[pid]/SARemoteDebugger
sun.jvm.hotspot.debugger.DebuggerException: java.net.MalformedURLException: invalid URL String: //[pid]/SARemoteDebugger
        at sun.jvm.hotspot.RMIHelper.lookup(RMIHelper.java:115)
        at sun.jvm.hotspot.HotSpotAgent.connectRemoteDebugger(HotSpotAgent.java:517)
        at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:374)
        at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
        at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:183)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:196)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.ObjectHistogram.main(ObjectHistogram.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at sun.tools.jmap.JMap.runTool(JMap.java:201)
        at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: java.net.MalformedURLException: invalid URL String: //[pid]/SARemoteDebugger
        at java.rmi.Naming.parseURL(Naming.java:243)
        at java.rmi.Naming.lookup(Naming.java:96)
        at sun.jvm.hotspot.RMIHelper.lookup(RMIHelper.java:113)
        ... 13 more
Caused by: java.net.URISyntaxException: Malformed IPv6 address at index 3: //[pid]/SARemoteDebugger
        at java.net.URI$Parser.fail(URI.java:2848)
        at java.net.URI$Parser.parseIPv6Reference(URI.java:3469)
        at java.net.URI$Parser.parseServer(URI.java:3219)
        at java.net.URI$Parser.parseAuthority(URI.java:3155)
        at java.net.URI$Parser.parseHierarchical(URI.java:3097)
        at java.net.URI$Parser.parse(URI.java:3063)
        at java.net.URI.<init>(URI.java:588)
        at java.rmi.Naming.intParseURL(Naming.java:273)
        at java.rmi.Naming.parseURL(Naming.java:237)
        ... 15 more





使用 E:\ruanjian\Java\jdk8\bin>jps  查看进程id号--------

结果输出:3144 org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar9788 Jps

E:\ruanjian\Java\jdk8\bin>jps -v---查看详细信息
结果输出:12920 Jps -Dapplication.home=E:\ruanjian\Java\jdk8 -Xms8m3144 org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar -Dosgi.requiredJavaVersion=1.7 -Xms256m -Xmx1024m
E:\ruanjian\Java\jdk8\bin>jmap -dump:live,file=E:/dumpFile/myheap.bin,format=b 3144------生成myheap.bin文件。
使用-h 帮助文件:
E:\ruanjian\Java\jdk8\bin>jmap -hUsage:    jmap [option] <pid>        (to connect to running process)    jmap [option] <executable <core>        (to connect to a core file)    jmap [option] [server_id@]<remote server IP or hostname>        (to connect to remote debug server)
where <option> is one of:    <none>               to print same info as Solaris pmap    -heap                to print java heap summary    -histo[:live]        to print histogram of java object heap; if the "live"                         suboption is specified, only count live objects    -clstats             to print class loader statistics    -finalizerinfo       to print information on objects awaiting finalization    -dump:<dump-options> to dump java heap in hprof binary format                         dump-options:                           live         dump only live objects; if not specified,                                        all objects in the heap are dumped.                           format=b     binary format                           file=<file>  dump heap to <file>                         Example: jmap -dump:live,format=b,file=heap.bin <pid>    -F                   force. Use with -dump:<dump-options> <pid> or -histo                         to force a heap dump or histogram when <pid> does not                         respond. The "live" suboption is not supported                         in this mode.    -h | -help           to print this help message    -J<flag>             to pass <flag> directly to the runtime system


























后面看到这个文章 写的好全:http://blog.csdn.net/fenglibing/article/details/6298326

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值