0

I have seen in tutorials, that with command jmap -heap<pid>, I can receive info about heap state.

Now this command is unavailable.

There are only jmap -dump:live,format:b,file=heap.bin but it save data to unreadable bin format.

How can I receive heap state info using jmap to console?

*On Windows

Upd. I found the answer: On new versions Jdk we can use command:

jhsdb jmap --heap --pid

3 Answers3

1

I found the answer. In new JDK versions it works:

jhsdb jmap --heap --pid <pid number>
0

If you are running on a Unix/Linux platform execute following command to generate the heap dump.

kill -3 <PID of the Java Process>

Generated heap dump file will be either in home directory of the user executed the command, or in absolute path of the jar file.

Steephen
  • 14,645
  • 7
  • 40
  • 47
0

You can analyze the heapdump generated by jmap -dump:live,format:b,file=heap.bin with https://www.eclipse.org/mat/. MAT is able to read the binary format.

leonardkraemer
  • 6,573
  • 1
  • 31
  • 54