我的应用程序正在设备上250MB的内存

我的应用程序正在设备上250MB的内存

本文介绍了我的应用程序正在设备上250MB的内存。当我做一个堆转储和分析它。它说7MB左右的堆大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有正在使用哪个不上堆转储显示另一个内存?我正在使用的Eclipse内存分析器。首先,我用转储和DDMS内存分析器选秀权堆。那只能说明堆的大小为7MB与直方图基本上是告诉我一切都很好。但是,我有我的设备上下载的几个内存监控的应用程序和他们都说我的应用程序正在250MB,并一路攀升。

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?

推荐答案

内存测量应用程序是不是很值得,因为,引用Dianne Hackborn 的:

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

请注意现代操作系统的内存使用像Linux是一个非常复杂和难于理解的区域。其实你什么号码,你得到的机会实际上是正确间preting极低。

话虽这么说,欢迎你使用她的回答列出的技术,试图得到什么这些工具都声称一个更好的处理,是否是一个真正的问题。

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.

还有:


  • 如果你有一个以上的过程中,请记住,DDMS堆转储是一个单一的过程

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

如果你正在做使用NDK本地开发,NDK分配不是托管堆的一部分,因此不包括在堆转储

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

这篇关于我的应用程序正在设备上250MB的内存。当我做一个堆转储和分析它。它说7MB左右的堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 06:51