How to take a heap dump in windows with minimum downtime?

后端 未结 1 805
情歌与酒
情歌与酒 2020-12-16 08:10

I want to figure out why JVM heap usage on Elasticsearch node is staying consistently above 80%. In order to do this, I take a heap dump by running

jmap.exe          


        
1条回答
  •  感情败类
    2020-12-16 08:36

    After you've taken the coredump by WinDbg, you need to extract the heap dump from it by running

    jmap -heap:format=b "C:\Program Files\Java\...\bin\java.exe" core.mdmp
    

    This could be done offline; no interaction with running Java process needed. Then you will be able to open the generated heap.bin in VisualVM.


    Alternatively you may take the class histogram. It is produced a way faster than full heap dump.

    jmap -histo 
    

    It shows you the list of classes whose instances occupy the most space in the heap. This information is often enough to get the idea of where's the memory lost.

    0 讨论(0)
提交回复
热议问题