Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : How to test memory leak in an application?

I have developed an app, I want to check the Memory leak happening in the app. I am trying with eclipse MAT, but unsuccessful,I am getting HROF file but eclipse MAT unable to read it. Can anybody help me out. Any other way to findout.

like image 805
Rahul Baradia Avatar asked Sep 21 '12 04:09

Rahul Baradia


People also ask

How do I check for memory leaks in a program?

The best approach to checking for the existence of a memory leak in your application is by looking at your RAM usage and investigating the total amount of memory been used versus the total amount available. Evidently, it is advisable to obtain snapshots of your memory's heap dump while in a production environment.

How do you identify a memory leak?

Running out of memory is the simplest way to identify a memory leak, and it's also the most common approach to uncovering one. That's also the most inconvenient way to find a leak. You'll probably notice your system slowing down before you run out of RAM and crash your application.


1 Answers

The dump.hprof file from Android needs to be converted. Then you can open the converted-dump.hprof in MAT.

hprof-conv dump.hprof converted-dump.hprof
like image 56
Morrison Chang Avatar answered Sep 22 '22 05:09

Morrison Chang