简体   繁体   中英

Java Eclipse Create Heap-Dump on Breakpoint

How do I make a heapdump at a breakpoint in eclipse?

My Java program has 2 versions that do the same thing with 2 different methods.
One of these methods runs into a Heap Space Exception but the other doesn't.

I was able to get the heapdump for the one that encountered an error by setting the VM argument -XX:+HeapDumpOnOutOfMemoryError

For the program using the method that doesn't get the error, I want to get a heapdump at a certain breakpoint. How can I do this?

  1. Install Eclipse memory analyzer plug in
  2. Set your debug point and start your application in debug mode and reach to the point where you would like to take Heap-Dump.
  3. Go to Memory Analysis perspective (Once you install plug-in you will find this perspective)

记忆分析的观点

  1. Then click on Acquire Heap Dump button and you will get all head dumps till that debug point.

获取堆转储

您始终可以使用jvisualvm连接到该进程,然后右键单击并进行堆转储。

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