简体   繁体   中英

My App is taking 250mb memory on my device. When I do a heap dump and analyze it. it says the heap size around 7mb

Is there another memory which is being used that doesn't show on a heap dump? I am using Memory Analyzer on Eclipse. First I dump the heap with DDMS and Memory Analyzer picks. it only shows that the size of the heap is 7mb and the histogram is basically telling me everything is fine. However, I have downloaded several memory monitoring apps on my device and they all say my app is taking 250mb and it keeps climbing.

How else can I try to find out why its taking so much memory?

在此输入图像描述

在此输入图像描述

Memory measuring apps are not worth very much, as, to quote Dianne Hackborn :

Note that memory usage on modern operating systems like Linux is an extremely complicated and difficult to understand area. In fact the chances of you actually correctly interpreting whatever numbers you get is extremely low.

That being said, you are welcome to use the techniques outlined in her answer to try to get a better handle on what those tools are claiming and whether it is really a problem.

Also:

  • If you have more than one process, bear in mind that DDMS' heap dump is for a single process

  • If you are doing native development using the NDK, NDK allocations are not part of the managed heap and therefore are not included in the heap dump

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM