如何找到内存泄漏等级/活动Android中 [英] How to find Memory Leak Class/Activity in Android

查看:138
本文介绍了如何找到内存泄漏等级/活动Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来这个Android的洗车台。在一种应用中,还有一个内存泄漏。但我没能在其中找到actiity或类内存泄漏发生。

I am New to this Android platfrom. In one application, there is a memory leak. But i couldn't able to find in which actiity or class the memory leak is happening.

我使用MAT得到了内存泄漏是否有或没有infirmation。但无法找到该活动被泄漏。

I am using MAT to get the infirmation that the memory leak is there or not. But not able to find which activity is leaking.

请告诉我如何找到哪个活动泄漏。

Please tell me how to find the which activity is leaking.

感谢。

推荐答案

即使这个问题是安静岁。我想,一个小教程,图像可能会有所帮助。所以,首先你需要安装 MAT插件。重新启动后,点击转储HPROF文件

Even if this question is quiet old. I think a small tutorial with images might be helpful. So first you need to install the MAT plugin. After a restart click on Dump HPROF file:

经过一段时间(约30秒),你会得到一个对话框,您可以点击完成。比你得到这样的观点:

After some time (about 30 seconds) you'll get a dialog where you can click on finish. Than you get this view:

在那里,你点击左侧的最大组成部分,过滤器的即将离任的引用。然后,你在这里得到这样的观点:

There you left click on the biggest part and filter for with outgoing references. Then you get this view here:

在这里你可以看到,我错过了删除,其中几个项目都储存在我的ContentManager的项目我的挂起的HashMap

Here you can see that I missed to delete items in my ContentManager where several items were stored in my pending HashMap.

这篇关于如何找到内存泄漏等级/活动Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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