LeakCanary:references android.view.inputmethod.InputMethodManager.mLastSrvView

最近发现项目中,一个地方总是报内存泄漏,LeakCanary给出的信息如下图所示:

LeakCanary泄漏信息

既然泄漏了,那么肯定得找泄漏的地方啊,android studio profiler 和 mat轮番上阵,但是就是找不到泄漏点,很奇怪。。。最后在github的LeakCanary 问题那发现了这个:
LeakCanary-Issues

GC ROOT static android.view.inputmethod.InputMethodManager.sInstance
references android.view.inputmethod.InputMethodManager.mLastSrvView
references com.xx.TextView.mContext
leaks com.xxx.activity.XXXActivity instance

LeakCanary 对于这个问题的回复:

Thank you for your report, it looks like this might be a leak in the Android SDK.

Please read the following entry in our FAQ: [Can a leak be caused by the Android SDK?](https://github.com/square/leakcanary/wiki/FAQ#can-a-leak-be-caused-by-the-android-sdk).

We don't have enough time to do the investigative work on this type of issue, so I will close this issue for now. We'll happily take contributions to `AndroidExcludedRefs.java`, if the leak is demonstrated and the fix provided to AOSP.

大概意思就是这可能是一个android sdk中的内存泄漏。。。。没精力管这种
然后我搜索了一下关于InputMethodManager的内存泄漏,发现很多这种问题,在15<=API<=23中都存在,特此记录一下,如果以后发现不是sdk问题而是代码问题的话,会纠正此贴~

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 176,060评论 25 709
  • 内存泄漏 内存管理 内存模型 Android原生开发以java为主。 在java中,Java内存模型,往往是指J...
    迷失的胖子阅读 3,401评论 0 0
  • HereAndroid的内存优化是性能优化中很重要的一部分,而避免OOM又是内存优化中比较核心的一点。这是一篇关于...
    HarryXR阅读 9,236评论 1 24
  • 高中看了片头看不下去就是因为个人觉得太恶心了,如今要不是因为徐老师推荐看真的不想看,尽管看了这么多电影还是无法接受...
    说吧_记忆阅读 3,717评论 0 0
  • Markdown注意事项和技巧 MarkDown使用两个空格和回车换行 或者两个回车换行 或者 进行换行 根据实际...
    q破晓晨曦p阅读 6,961评论 0 1

友情链接更多精彩内容