2

I am using Java1.8 in Ubuntu Linux machine. Created a thread dump with below command:

jcmd 1670 Thread.print > Thread.jfr

Copied File to local MAC machine and double clicked to open in JMC. It failed to open. HOw to open it?

I tried to open same file in STS with memory analyzer installed, it does not identify jfr file.

1) What is the wrong with above approach?

2) What is the best tool to analyze Thread and Heap dump?

3) Is Heap or Thread dump size is dependent on RAM size? we have 64 GB ram system, assigned 40GB to one of app server. Is any problem with this?

AKB
  • 5,918
  • 10
  • 53
  • 90
  • Thread and heap dump are different things. Heap dump size depends on configured heap size of the VM. Thread dump size depends on the number of threads active. You can trigger a thread dump to STDOUT using "jstack" from the jdk. I get heap dumps only if the VM stoppes with an out of memory error (by VM configuration). I use JMAT (eclipse project) to analyze heap dumps. Threads dumps can be analyzed with a text editor or upload to some web service. 40GB heap size of the VM can be a problem if the garbage collector stops the execution. – Konrad Aug 02 '18 at 23:43

1 Answers1

1

1) A JFR file is a file with plenty of information produced by the JDK Flight Recorder. It is in a binary format. You can’t just rename a textual thread stack dump to make it a flight recording.

2) Depends on what you’re looking for. Eclipse MAT is good for heap dumps. If you want to do heap waste analysis, JOverflow is good (see my blog at http://hirt.se/blog/?p=854). There is a thread analysis plugin for JMC, but I’ve gotten used to have richer information than just thread stack dumps. I suggest taking a closer look at JFR and JMC.

3) Heap dumps will, depending on how you dump, be proportional to the live data on your Java heap. Thread stack dumps will be proportional to the number of threads and how deep the traces are.

If you want to learn more, check out this blog: http://hirt.se/blog/?p=939

Hirt
  • 1,664
  • 10
  • 12