简体   繁体   中英

How to use jmap heap

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

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.

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM