为什么使用在启动这么多的内存我的Andr​​oid应用 [英] Why is my android app using so much memory at startup

查看:176
本文介绍了为什么使用在启动这么多的内存我的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找到一个内存泄漏问题了一段时间。

I have been looking into a memory leak issue for a while.

我发现从 HTTP在互联网上的Cover Flow ://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html

现在我是IM pression这个程序是造成内存溢出我的问题之下,它仍然有可能,它有什么用它做。不过,我已经从不同的开机画面我的应用程序删除一切。没有其他的活动。它什么也不做......

Now I was under the impression this app was causing my outofmemory issues, and its still possible that it has something to do with it. However, I have deleted everything from my application except the splash screen. There are no other activities. and it does Nothing......

最初的意图加载开机画面的活动。

The initial intent loads the Splash Screen activity.

我的应用程序是79和83我可用堆百分比之间使用。这款手机给了我2.816M,我显然已经分配2.278M这最后的运行。

My application is using between 79 and 83 percent of my available heap. The phone has given me 2.816M and i have apparently allocated 2.278M this last run.

首先,可用空间来运行应用程序的3M好像不是很多。然而,在初始引导加载到内存2.2M好像当我做的是加载与ImageView的一个活动的唯一的事情指出,在大约4K测量的图标资源消耗一吨的记忆......

First off, 3M of available space to run an app seems like not a lot. However 2.2M loaded into memory at initial boot seems like a ton of memory consumed when the only thing I am doing is loading a single activity with an imageview pointed to an icon resource measured at around 4k......

如何/为什么用我的应用程序白白这么多的内存,我怎么可以缓解在引导我的80%的内存消耗。

How/Why is my app using so much memory for nothing, and how can I alleviate my 80% memory consumption at boot.

我开发一个T-Mobile G2的,我什么都没有,除了这个程序,并默认服务,在一个机器人在运行了。

I am developing on a T-Mobile G2 and I have nothing running except this app and the default services that run on a droid.

下面是我的一些内存转储信息

here is some of my memory dump info

1犯罪嫌疑人

2,239 instances of "java.lang.Class", loaded by "<system class loader>" occupy 673,760 (35.83%) bytes.

Biggest instances:

class com.ibm.icu4jni.util.Resources$DefaultTimeZones @ 0x401dc878 - 166,600 (8.86%) bytes.
class android.text.Html$HtmlParser @ 0x4010de58 - 126,592 (6.73%) bytes.
class org.apache.harmony.security.fortress.Services @ 0x4007fd98 - 51,456 (2.74%) bytes.
class android.content.res.Resources @ 0x4004bb78 - 38,768 (2.06%) bytes.
class com.abc.AppData @ 0x44d1e040 - 26,872 (1.43%) bytes.


Keywords
java.lang.Class

2犯罪嫌疑人

7,072 instances of "java.lang.String", loaded by "<system class loader>" occupy 435,560 (23.16%) bytes. 

Keywords
java.lang.String

3犯罪嫌疑人

58 instances of "org.bouncycastle.jce.provider.X509CertificateObject", loaded by "<system class loader>" occupy 289,288 (15.38%) bytes. These instances are referenced from one instance of "java.util.Hashtable$HashtableEntry[]", loaded by "<system class loader>"

Keywords
org.bouncycastle.jce.provider.X509CertificateObject
java.util.Hashtable$HashtableEntry[]

你可以看到系统似乎是装载和使用所有我所得到的记忆。我怎样才能得到它给我更多的内存。 3兆不是很多的工作。我试图展示一个图片库。

as you can see the system appears to be loading up and using all of the memory I have been given. How can I get it to give me more memory. 3 megs is not very much to work with. and I am trying to show an image gallery.

推荐答案

我遇到了在过去的内存泄漏,但不与机器人。在过去,我用Eclipse的内存分析工具(第二个链接),我发现非常有用的。要使用它,你需要生成一个堆转储文件(或内存快照),博客文章告诉你如何做到这一点(第一个链接)。

I have run into memory leaks in the past but not with android. In the past I used the eclipse memory analyzer tool (second link) which I found very useful. To use it you need to generate a heap dump file (or memory snapshot), the blog post tells you how to do this (first link).

http://www.andorfi.net/2011 / 03 /内存分析换的Andr​​oid的应用程序/

http://www.eclipse.org/mat/

这篇关于为什么使用在启动这么多的内存我的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆