jhat

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 called. Basically I can tell that there are several hundred meg of hash table entries ([java.util.H...

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, but it appears that hprof generates dumps in exactly the same format. This is JDK 1.6.0_...

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 [Lcom.sun.mail.imap.IMAPMessage; 790 16254336 class [C 124512 12832896 class [I 23080 11923504 ...

OQL for finding new objects only in heap dumps?

Does anyone know the OQL syntax for finding new objects only in a heap output? I can't find good documentation on OQL options, sun even has an example of new-only output without sample syntax of the query that generated it.What I've done is Created a set of heaps with jhat Served them up with jmap -baseline, which marks objects not in ...

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 jvm args for minimum settings, but it rejects any minimum, and seems to run out of memory be...

Why is JHAT missing "Object allocated from"

I am running the JHAT memory profiler. This example shows information attached to a single object: https://hat.dev.java.net/doc/examples/object.html This info includes a section "object allocated from". When I run jhat, I get everything except the "object allocated from" section. Why? I can't see any setting that controls this. Enviro...

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

Hi All, 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 come up with the following, but this doesn't show subclasses of foo.bar.Cacheab...