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.

12 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. 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
  4. Your blog always delivers new and exciting info. This one is no exception!

    chip guidelines

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

    ReplyDelete
  6. 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
  7. Thanks for sharing such a convincing and much-needed blog post. Nice work!

    healthy harvest

    ReplyDelete
  8. Really enjoyed this post. The ideas are practical and easy to understand, especially for beginners. It’s refreshing to read content that feels honest and helpful instead of overly technical. Looking forward to more!
    Small Business Tax Planning Services in Fort Worth TX
    Business Tax Planning and Preparation Fort Worth TX

    ReplyDelete
  9. Really enjoyed this post. The ideas are practical and easy to understand, especially for beginners. It’s refreshing to read content that feels honest and helpful instead of overly technical. Looking forward to more!
    nsf certified vitamins
    top care vitamins

    ReplyDelete

  10. If you're looking to enhance your custom apparel designs, exploring various transfer options can make a significant difference. One effective method is to buy dtf transfers, which provides high-quality results and durability. Whether you're a hobbyist or a professional, these transfers are a great investment for achieving vibrant and long-lasting prints. Remember to choose the right transfer for your specific needs to ensure the best outcome.

    ReplyDelete
  11. You’ve clearly done your research. The depth of information here sets this article apart from others.
    bakery sterling il

    ReplyDelete

Popular Posts