一个资源收购,在连接的堆栈跟踪,但从来没有公布过。见java.io.Closeable的信息,避免资源泄漏 [英] A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks
问题描述
我得到在logcat中该消息的的资源收购,在连接的堆栈跟踪,但从来没有公布过。见java.io.Closeable有关避免资源泄漏的信息。在哪里查找泄漏?它叫见java.io.Closeable
i am getting this message in logcat A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. where to look for leak and what does it meant by " See java.io.Closeable"
推荐答案
这意味着你已经打开了的东西,但从来没有关闭它们。的 可关闭
有一个方法关闭
,你必须调用释放与相关联的资源组件时,你不再需要它。
That means you have opened something but never close them.Closable
have a method close
which you must call to release the resources associated with the component when you no longer need it.
要查找泄漏,你可以尝试<一href="http://android-developers.blogspot.kr/2011/03/memory-analysis-for-android.html"><$c$c>MAT$c$c>,我经常用它来查找内存泄漏(静态数据保持一个参考的活动,等等)。
To look for the leak, you can try MAT
, I often use it to find memory leaks(static data holding a reference to Activity, etc).
这篇关于一个资源收购,在连接的堆栈跟踪,但从来没有公布过。见java.io.Closeable的信息,避免资源泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!