从活动的内存没有释放 [英] Memory from activities not released

查看:86
本文介绍了从活动的内存没有释放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有一些前台活动的应用程序,也可以更新一些小部件的服务。
问题是,当处理仍然是服务,从所述其他活动的存储器,当它们打开时,是从来没有被回收。

I've an application that has some foreground activities and also a service that updates some widgets. The problem is that, as the process remains for the service, the memory from the other activities ,if they are opened, is never reclaimed.

看着<一个href=\"http://stackoverflow.com/questions/1977246/android-finish-method-doesnt-clear-app-from-memory\">that从罗马盖伊的反应似乎可以正常。但它是?对于多少时间的android保持不使用活动的资源呢?他们能活几个小时?

Looking at that response from Roman Guy it seems that can be normal. But it is? For how much time android keeps the resources of not used activities? They can live for hours?

我怎么可以很容易地知道,如果活动是泄露或被很简单没有回收?我试着从AndroidMarket的(FreeMemoryRecover)的程序和它的清零,但我怀疑它杀死进程,然后重新启动该服务...

How can I know easily if the activities are leaked or are simple not reclaimed? I've tried with a program from AndroidMarket (FreeMemoryRecover) and it's cleared but I suspect that it kills the process and then restart the service...

任何帮助或建议将大量AP preciated。

Any help or suggestion will be heavily appreciated.

注1:我用HEAPDUMP + Eclipse的MAT调查,我没有看到陌生引用拿着我的活动

Note 1: I've investigated with a HeapDump + Eclipse MAT and I don't see strange references holding my activities

注2:我已经问到这个问题的一些问题:

Note 2: I've already asked some questions about this problem:

  • Post 1
  • Post 2

推荐答案

我会尝试以下方法:

启动应用程序用它玩,以确保它完全加载并使用尽可能多的内存就可以了。

Launch your app play with it to be sure it is fully loaded and use as much memory as it can.

然后点击主页按钮,启动导航,打开techcrunch.com,lemonde.fr,youtube.com,dailymotion.com,发动来自YouTube的视频,打开并播放愤怒的小鸟和最后但并非最不重要开拓PDF文档。

Then hit the home button and launch the navigator, open techcrunch.com, lemonde.fr, youtube.com, dailymotion.com, launch a video from youtube, open up and play angry bird and last but not least open up a pdf document.

之后,Android将有所需的内存背面相当肯定的。如果您的应用程序仍然存在,你可能有一个问题,如果它不是,那么一切都进行得很顺利。

After that Android will have needed the memory back quite for sure. If your app is still there, you might have a problem, if its not, then everything went smoothly.

顺便说一句,好你放这么多关注的是在AndroidLand一个好公民!

By the way, good on you to put so much concern in being a good citizen in AndroidLand !!

这篇关于从活动的内存没有释放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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