I am a beginner developer and I am sure I have a memory leak in my android application. When I open my app for the first time and check the heap size using DDMS tool from Eclipse it shows 4.5 MB. With every new opening of my app (close and reopen it) the heap size is increasing until it reaches 5.8 MB and then it settles at this size going up or down just a little bit. I also see that the amount of allocated objects increases from 44k to 60k. That is crazy I guess. But why it stops increasing at that particular point of memory (5.8 MB) and amount of objects (60k)? Furthermore, for some reason Android Application Manager's "Cached background processes" section shows that my app memory consuption increases from 10 MB to 24 MB and settles there. Why do these numbers differs from what DDMS shows? Anyway, these two tools show the same behaviour: that is with every opening my app's memory is increasing. I have tried setting all my instance variables to null in onDestroy() methods of my every activity or fragment but it didn't help. What else can I do?
Sent from my GT-I9300 using XDA Free mobile app
Sent from my GT-I9300 using XDA Free mobile app
Last edited: