map original memory leak from mat message

107 Views Asked by At

I can use MAT and I got message showing my package name with shallow and retained heap. From this , how can I locate the line of code cause memory leak?? any body, please help me, thanks in advance. below is the Dump HPROF file message enter image description here

1

There are 1 best solutions below

0
On

The above screenshot is looking at incoming references by class, which is interesting but the more common way to investigate a leak is to run Merge Shortest Paths to GC Roots: this will tell you what is keeping your objects alive. MAT will never be able to point you to a specific line number as it only shows the object reference graph (unless you use the Java Basics > Thread Overview and Stacks query and find a problem on a particular frame).