OutOfMemory exception occurred frequently in an Android app with more than ten activities. I want to calculate the memory usage for each activity, is there any way?
Asked
Active
Viewed 59 times
-1
-
You can use MAT Plugin. This SO question has tutorial on it http://stackoverflow.com/questions/3714394/how-to-find-memory-leak-class-activity-in-android – Randyka Yudhistira Jan 23 '15 at 02:06
1 Answers
-1
Use DDMS (DDMS perspective in Eclipse or Device Monitor from Android Studio I think. Select the process on the left and click the "Update Heap" button. Find the memory information on the right. Your process needs to be set to be debuggable for this.
But I don't think this can distinguish between Activities though.
If you need more detailed information you can make DDMS dump an hprof file with your complete heap contents for further analysis. Use these instructions to convert the file format,
hprof-conv <infile> <outfile>
and then use the Eclipse Memory Analyzer to open and inspect it.