Pieces of heap root

We have a production system turning into an endless cycle of full gc, and memory drops amount to 8 concerts, like 1 MB in just 2 minutes.

After taking a heap dump, he tells me that there is an array java.lang.Object ([Ljava.lang.Object) with millions of java.lang.String objects having the same line that takes 99% of the heap.

But this does not tell me which class refers to this array, so that I can fix it in the code.

I took a bunch of heaps using the jmap tool on JDK 6 and used JProfiler, NetBeans, SAP Memory Analyzer and IBM Memory Analyzer, but none of them told me what this huge array of objects is called up to ...? How does the class refer to it or contains it.

Do I have to take a different dump with a different configuration to get this information? ... Or anything else that can help me find out that the culpable class is causing this ... it will help a lot.

+4
source share
3 answers

I used the SAP Memory Analyzer in the past, and it’s a really great tool for finding β€œGreedy Pigs of Memory”.

Perhaps the following presentation may help: Efficient Java heap memory analysis on Enterprise-Scale .

+3
source

I used the Eclipse Memory Analyzer to find such problems. Usually, when it is something direct, it is quite easy to find the culprit, but it requires some getting used to the conditions. Without an actual reset in my hand, I cannot tell you what might cause this problem. Perhaps you should see what this line actually contains, where did it come from?

+1
source

Have you tried to just grep this line through sources and classes?

0
source

All Articles