Heap Dump Root Classes

We have production system going into infinite loop of full gc and memory drops form 8 gigs to like 1 MB in just 2 minutes.

After taking heap dump it tells me there an is an array of java.lang.Object ([Ljava.lang.Object) with millions of java.lang.String objects having same String taking 99% of heap.

But it doesn’t tell me which class is referencing to this array so that I can fix it in the code.

I took the heap dump using jmap tool on JDK 6 and used JProfiler, NetBeans, SAP Memory Analyzer and IBM Memory Analyzer but none of those tell me what is causing this huge array of objects?? … like what class is referencing to it or contains it.

Do I have to take a different dump with different config in order to get that info? … Or anything else that can help me find out the culprit class causing this … it will help a lot.

I’ve used SAP Memory Analyser in the past and it’s a really great tool to find “Greedy Memory Pigs”.

Maybe the following presentation can help: Effective Java Heap Memory Analysis on

I’ve used the Eclipse Memory Analyzer before to find problems like this. Usually when it’s something straightforward it’s fairly easy to find the culprit, but it takes some getting used to the terms. Without the actual dump in hand I can’t tell you what might be causing this problem. Perhaps you should look at what this string actually contains, where is it coming from?

did you tried to simply grep this string through sources and classes ?

Leave a Comment