Error reported by jmap command under Windows

    Recently, I changed my laptop. In the new working environment, the jmap command is actually reporting errors, and JPS, jstat, Jinfo and jstack can be used normally. Therefore, the problem of process number is preliminarily eliminated

Attaching to core 17536 from executable heap, please wait...
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(
        at sun.jvm.hotspot.HotSpotAgent.attachDebugger(
        at sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(
        at sun.jvm.hotspot.HotSpotAgent.setupDebugger(
        at sun.jvm.hotspot.HotSpotAgent.go(
        at sun.jvm.hotspot.HotSpotAgent.attach(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(

At the same time, I tried jmap heap XXX a non-existent process number (a pit is buried here first), but still reported the same error. According to the information of the exception stack, it is suspected that the command line under Windows does not have administrator permissions and cannot access the dump file, so I tried to run CMD as an administrator, and then jmap heap, However, the same mistake is reported:

I’m helpless now. Baidu and stackoverflow haven’t found a solution to the problem after walking around… Let’s go first

gorgeous separation line

I don’t know how long later, I suddenly remembered — “didn’t you hit the right command?” jmap – H take a look at the red box in the screenshot, and then lower your head in shame (it must be caused by eating too many mid autumn moon cakes, huh!)

as shown in the figure, jmap has three uses: 1. Connect the running process; 2. Analyze the core file, that is, dump file; 3. Connect the JVM processes of other machines. Therefore, the problem with the jmap heap XXX command above is that you forget to add “-” and jmap is regarded as analyzing the snapshot file of “heap”, and it is natural to report an error


    In JDK’s own toolkit, for commands such as JPS, jmap, jstack, etc., specifying option generally requires “-” and the following parameters do not contain bars, which should be kept in mind. And make complaints about the exception. Don’t panic. You must read the abnormal information and abnormal stack carefully. In this case, the first line has already been clear. (if you put the filename out, you can print it out better)

Similar Posts: