Friday, June 6, 2014

How to use jmap and jhat

1. Using jmap to take a memory dump of process 1234, save the dump file as "heapdump".

[root]# jmap -dump:format=b,file=heapdump -F 1234
Attaching to process ID 1234, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 20.45-b01
Dumping heap to heapdump ...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Heap dump file created

2.  Using jhat to analyze the file "heapdump" and start a http service.

jhat -J-Xmx256m heapdump

3. Open browser to http://<IP of the server>:7000/

"Show heap histogram"
"Show instance counts for all classes (excluding platform)"

Then we can identify the super class with most instances.

8 comments:

  1. Dear Students! We cover a multitude of academic topics, so you’ll surely get what you need. An authentic study in line with your instructions is guaranteed. Depending on the number of pages and degree of trickiness, our pros can complete your order in 3-6 hours and more.

    ReplyDelete
  2. Very well written. Your blogs always impress me. Keep up the good work. Expecting the same from you. 
    libertarian kids books

    ReplyDelete
  3. I’m impressed by the depth of research in this post. Clearly, a lot of effort went into it.

    cash for homes Atlantic Beach FL

    ReplyDelete
  4. Without a doubt, this post is incredible. Every time I read your blog, I’m captivated by the way you explain things so clearly and effectively.

    amazon accounting

    ReplyDelete
  5. Your blog always delivers new and exciting info. This one is no exception!

    chip guidelines

    ReplyDelete
  6. Your article gave a clear, comprehensive overview—perfect for beginners like me.
    online grocery coupons

    ReplyDelete
  7. The quality of your blog content is impressive. It’s always informative and useful. I’m looking forward to your future updates—keep posting!

    accounting payable

    ReplyDelete
  8. Thanks for sharing such a convincing and much-needed blog post. Nice work!

    healthy harvest

    ReplyDelete

Popular Posts