3

I'm trying to convert JVM core dump to HPROF format with following command jmap -dump:format=b,file=dump.hprof $(which java) core.dump.9

and getting the following error

Error: More than one non-option argument
Cannot connect to core dump or remote debug server. Use jhsdb jmap instead

What am I doing wrong and are there other tools to convert it? JDK is OpenJDK 11.0.4.

synapse
  • 5,388
  • 6
  • 29
  • 60
  • Changing it to `/usr/local/openjdk-11/bin/java` doesn't help – synapse Jul 31 '19 at 17:50
  • Suggestion: type `cd /usr/local/openjdk-11/bin/java/bin; ./pmap` and see if the options are all valid with OpenJDK11. If they are, then type `./pmap dump:format=b,file=dump.hprof /usr/local/openjdk-11/bin/java /path/to/file/core.dump.9` – paulsm4 Jul 31 '19 at 18:05

1 Answers1

4

Since JDK 9 jmap works only with a live JVM through the Dynamic Attach mechanism.

The 'forced' mode jmap -F was replaced with a separate utility jhsdb.

Use the following command to produce a heap dump from a core file:

jhsdb jmap --binaryheap --dumpfile dump.hprof --exe /usr/local/openjdk-11/bin/java --core core.dump.9
apangin
  • 86,266
  • 9
  • 178
  • 218