Is it possible to view threads from hprof dump / threads in heap dump

前端 未结 7 1492
粉色の甜心
粉色の甜心 2021-02-06 06:46

I have got a large (5GB) hprof dump, created by application when OutOfMemoryError occurred. (Using XX: HeapDumpOnOutOfMemoryError ).

Unfortunately there

相关标签:
7条回答
  • 2021-02-06 06:47

    To turn on an option your need + and to turn off an option you need -

    What is confusing about the documentation is that it shows the default setting to make it "clear" what setting you have already. The ones with + are on by default and the ones with - are off by default. This means if you copy any of the + or - options from the documentation they should do nothing (except where the default has changed over time)

    -XX:-HeapDumpOnOutOfMemoryError turns off the heap dump, which is the default.

    -XX:+HeapDumpOnOutOfMemoryError turns on the heap dump.

    0 讨论(0)
  • 2021-02-06 06:53

    MAT can show the threads directly now (perhaps this was added since the question was asked).

    Threads Overview

    To get an overview of all the threads in the heap dump use the "Thread Overview" button in the toolbar, as shown on the image below. Alternatively one could use the Query Browser > Thread Overview and Stacks query:

    0 讨论(0)
  • 2021-02-06 06:54

    Eclipse MAT allows you to see the suspect threads in the Leak suspects report. Look for the classes in your application namespace with their line numbers to find how much memory they occupy in heap. This will give you a hint of leaky classes.

    0 讨论(0)
  • 2021-02-06 06:56

    You can kill -3 the process id to get a thread dump to standard out. This will not kill the java process so you can do it as many times as you want.

    as RC stated visualVM is a good tool which will give you Object counts by class type and all kinds of graphs and profiling tools.

    0 讨论(0)
  • 2021-02-06 06:57

    Use visualvm.

    try to analyse the graph when perm heap space exceeds... u should also check the memory samples & save its snapshot..

    Analysis the thread stack... will help you narrow down to the problem.

    0 讨论(0)
  • 2021-02-06 07:02

    I don't think heap dump contains thread information except GC root. If you need thread related information, you need to take thread dump also.

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