Android - strange app Heap behavior
I measure acutal allocated RAM of my Application by DDMS and it's cause GC, which shows actual allocated RAM.
I have made simple project of activities, which goes one by one. Here is status of memory allocation (in MB):
----> I am opening activities
Begin > 2,258 > 2,305 > 2,335 > 2,366 > 2,390 > 2,419 > 2,441 > 2,472 > 2,496
And now I go back to the first activity:
I am closing activities <----
...End < 2,315 < 2,318 < 2,340 < 2,370 < 2,392 < 2,423 < 2,445 < 2,477
My results - despite I have returned back to the starting point of my app, there is about 60kB bigger allocated space? Why so? I am certain, when I try open m开发者_Go百科ore intens this way and then close them, the difference would be bigger. Does my App holds at the ...End point still some "traces" of references to last activities?
Thx
Make sure to release all references in the ondestroy method of your activities.
精彩评论