8

I have a windows memory dump (DMP) file of a JVM process.

Is there any way I can use Java tooling to do a heap analysis of this? The SDK tools (jhat etc.) don't seem to help - they all seem to expect a Java heap dump.

(I've plenty of Windbg experience, but I am a complete ignoramus when it comes to Java debugging)

This similar question: Dump file analysis of Java process? has no answer on this point.

Community
  • 1
  • 1
James World
  • 29,019
  • 9
  • 86
  • 120
  • Why don't you just do a heap dump with [`jmap`](http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html), and then analyze it in [`Eclipse MAT`](http://www.eclipse.org/mat), for example? – npe Jun 20 '12 at 14:21
  • 2
    Because all I have been given is a DMP file... the process is long gone. This is post-mortem analysis. – James World Jun 20 '12 at 14:24
  • I don't believe there is a way to convert a core dump into a heap dump. All the Java tools are designed to use heap dumps. – Peter Lawrey Jun 20 '12 at 14:38
  • jmap support extracting stuff from unix core file.. see if this work for windows as well. (this is new in jdk 7) – J-16 SDiZ Jun 20 '12 at 14:41
  • Which JDK you are using Oracle/IBM ? – Santosh Jun 20 '12 at 15:34
  • I've just got the standard Oracle download right now. Some searching on the net showed up an IBM tool called "jextract" which may (?) do a conversion to a format jmap can read - but I can't figure out if/how I can download it for free. It doesn't seem like jmap can handle windows DMP files natively. – James World Jun 20 '12 at 23:25
  • @JamesWorld Are you analyzing a JVM crash? – fglez Mar 06 '13 at 11:59
  • @JamesWorld did you ever solve this? I too have been given a (DMP) file. 13G of a wildfly server that was having issues. If I can solve this without trying to recreate the issue... In this case the server didn't crash but was very close to doing so. – D-Klotz Jun 24 '18 at 20:42
  • Figured it out. Use this: jmap -F -dump:format=b,file=jvm.hprof "C:\Development\Tools\jdk1.8.0_171\bin\ava.exe" java.DMP just in case someone else comes down this road. – D-Klotz Jun 24 '18 at 21:03

2 Answers2

1

See my other answer covering exactly that, how to get Java information from Windows minidump

Codeguard
  • 7,787
  • 2
  • 38
  • 41
0

If i understood your question properly then i would suggest you to use jconsole you can find under jdk.

You can find API here

http://docs.oracle.com/javase/6/docs/technotes/tools/share/jconsole.html

Ashay Jain
  • 98
  • 6