通过FinalizerReference可能发生的内存泄漏 [英] Possible Memory leak through FinalizerReference

查看:441
本文介绍了通过FinalizerReference可能发生的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小型的android应用程序,尝试查找内存泄漏,因此单击了"Dump Java Heap",列表中的第一个类是FinalizerReference(java.lang.ref).它有500多个实例,每个实例在另一个FinalizerReference上都有一个下一个"和上一个".

I have a small android app and I tried looking for memory leaks, so I clicked 'Dump Java Heap' and the first class on the list is FinalizerReference (java.lang.ref). It has over 500 instances, each one with a 'next' and 'prev' to another FinalizerReference.

我知道FinalizerReference来自实现Object.finalize()的对象,但是我的应用程序中没有实现该对象的对象.我如何找出这种泄漏的原因并加以解决?

I know that FinalizerReference comes from objects that implement Object.finalize(), but I don't have an object in my app that implements it. How can I find out why this leak happens and fix it?

推荐答案

有关您的问题的更多详细信息,请查看Finalizer referent 字段. 终结器对象只是扩展的Reference,因此您可以调查内容.它将为您提供有关终结对象的信息.

For more details about your issue, look at the referent field of your Finalizer. Finalizer objects are just extended References, so you could investigate the content. It will give you information about the finalizing objects.

根据内容,您将获得新的潜在客户.挂起对象的完成过程可能很长.由于只有一个线程可以处理所有线程,因此您可能会以某种方式完成更多任务.

Depending on the content, you will have new leads. It is possible that the finalization process for the pending objects is very long. As you have only one thread processing them all, you may be somehow finalizing more than you can.

欢呼

这篇关于通过FinalizerReference可能发生的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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