Android Memory Leak : InputMethodManager, Bitmap

别来无恙 提交于 2019-12-07 03:35:51

问题


This is kind of weird, I'm able to get rid of my own memory leaks, but I'm not able to do the same in this case.

Image below shows the heap contains Bitmap (like 2.5 MB) which is linked from current Activity (mDecor points to current Activity).

I've tried to remove InputMethodManager instances all over the application, no effect

I've tried setting default state of keyboard (if the bitmap is some kind of sprint drawable for system keyboard), still no effect

android:windowSoftInputMode="stateHidden"

Nothing helped, is there anything I can do about this? Note that the solution is not Android API version specific (I've tested on API 8 and 14/15/16, and all of them have the same issue)


Probably a bug, can someone please confirm that?

  • http://code.google.com/p/android/issues/detail?id=34731
  • Main Activity is not garbage collected after destruction because it is referenced by InputMethodManager indirectly
  • InputMethodManager holds reference to the tabhost - Memory Leak - OOM Error

来源:https://stackoverflow.com/questions/12681709/android-memory-leak-inputmethodmanager-bitmap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!