开发者

Android - strange app Heap behavior

开发者 https://www.devze.com 2023-04-01 05:13 出处:网络
I measure acutal allocated RAM of my Application by DDMS and it\'s cause GC, which shows actual allocated RAM.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消