Questions tagged [jhat]

jHat refers to Java Heap Analysis Tool.

Definition:

jhat refers to Java Heap Analysis Tool.

It is a tool that can be run in the command line, with which the user can analyze a heap by browsing a binary heap dump file.

Example Usage:

jhat [ options ] <heap-dump-file>

Important Links:

33 questions
150
votes
12 answers

How to find a Java Memory Leak

How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find the root reference (ref) or whatever it is…
jwiklund
  • 2,058
  • 2
  • 15
  • 10
74
votes
2 answers

What does the class class [B represents in Java?

I am trying out a tool jhat here to test my java memory usage. It reads in a heap dump file and prints out information as html. However, the tables shows as follows: Class Instance Count Total Size class [B 36585 49323821 class…
erotsppa
  • 14,248
  • 33
  • 123
  • 181
25
votes
4 answers

Loading a large hprof into jhat

I have a 6.5GB Hprof file that was dumped by a 64-bit JVM using the -XX:-HeapDumpOnOutOfMemoryError option. I have it sitting on a 16GB 64-bit machine, and am trying to get it into jhat, but it keeps running out of memory. I have tried passing in…
liam
  • 3,830
  • 6
  • 32
  • 31
13
votes
2 answers

Is there any way to analyze a truncated Java Heap Dump (hprof file)?

In my work, we are running into a difficult to reproduce OOM issue. Or, more accurately, it is very easy to reproduce on one system, making that system unusable, but difficult to reproduce anywhere else, given the same inputs. The application is…
user1410910
  • 1,050
  • 6
  • 12
8
votes
3 answers

Better ways to identify objects not getting garbage collected?

In a nutshell I have a program that is gradually using more and more memory over time. I am using jmap and jhat to try and diagnose it but am still not quite there. Background The program is a long-running server backed by an hbase datastore…
juhanic
  • 805
  • 8
  • 16
8
votes
0 answers

Export (or serialize) object from Java Heap Dump

I have a heap dump from a (formerly) running Java process. At the time the dump was taken, the process was hung communicating with another server. I would like to be able to reconstruct the exact request that was made by my application. Although my…
Adam Batkin
  • 51,711
  • 9
  • 123
  • 115
7
votes
5 answers

Why GC doesn't collect my objects?

I have a java program which keeps calling java.util.zip to compress/decompress data. It runs out of memory within a few seconds. I had a memory dump with jmap and I'm viewing it with jhat. Finalizer summary shows Total instances pending…
woodings
  • 7,503
  • 5
  • 34
  • 52
6
votes
3 answers

jhat throwing unrecognized magic number

I am trying to analyse a heap dump taken from a java process that ran into memory issues. The dump was taken using jmap. I am using jhat on the dump file - I am getting java.io.IOException: Unrecognized magic number: 169897589 at…
Bhaskar
  • 7,443
  • 5
  • 39
  • 51
5
votes
1 answer

OQL query to find all instances and sub-instances of a given class referred to from a session

I'm trying to use jhat/OQL to trace a memory leak in our Tomcat container. The question I want to ask is: "Show me all the instances (and sub-instances) of foo.bar.Cacheable class that are reachable from javax.servlet.http.HttpSession" I managed to…
Scruffers
  • 4,984
  • 8
  • 35
  • 41
4
votes
2 answers

JHAT cannot analyze a memory dump

I have a Memory Dump file and JHAT gives the following message and I cannot analyze anything (as no data is displayed. Resolving 0 objects... WARNING: hprof file does not include java.lang.Class! WARNING: hprof file does not include…
sheki
  • 8,991
  • 13
  • 50
  • 69
4
votes
2 answers

Why doesn't the -baseline option of jhat work?

How come every object appears to be marked new, instead of just objects that are in the second snapshot but not in my baseline snapshot? Looking around online, I see some suggestions that I need to use hprof instead of jmap to make my memory dumps,…
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
3
votes
0 answers

How do I analyze a Java heap dump when local memory is less than the size of the dumped heap?

I have a really big hprof file about 21G which located on a remote server with 32G memory, and I would like to understand what happened in my program. However, on my local desktop I have only 8G memory so it's impossible to launch this file…
Nikita Duginets
  • 163
  • 1
  • 6
3
votes
1 answer

How to find memory leaks in my Java application

This is a follow-up question from my previous question HERE. I was witnessing memory leaks in my Java application. Initially, I was thinking that the leak is coming from the Server component of my application. But as per other's suggestion, it…
Tina J
  • 4,983
  • 13
  • 59
  • 125
3
votes
3 answers

How to analyze the heap dump using jhat

I ran the jhat on the heap dump, it has generated the reports. How do i use the report to analyze the heap.I couldn't understand completely other than the instance count. Is there any references or case studies on that. In short, i need to proceed…
John
  • 2,682
  • 5
  • 23
  • 24
3
votes
1 answer

Mat can't open the dump file

My jmap command is sudo -u flume /usr/java/jdk1.8.0_60/bin/jmap -F -dump:format=b,file=heap.hprof pid, But eclips mat can't open the dump file,and throw an exception. java.lang.NullPointerException at…
Dev Zhou
  • 865
  • 2
  • 14
  • 21
1
2 3