Could not read input channel file descriptors from parcel crash report

前端 未结 1 669
星月不相逢
星月不相逢 2020-12-10 19:15

I receiving constant this crash report from my android app.I didn\'t understand what is this error ? What can be cause this ?

java.lang.RuntimeException: Cou         


        
相关标签:
1条回答
  • 2020-12-10 19:54

    I had same error. It absolutely disappeared after I cleaned all the memory leaks. Also disappeared java.lang.IllegalStateException: eglMakeCurrent failed EGL_BAD_ALLOC. Memory leak in Java means that Garbage Colector can't clean objects - there are some cross references. And there are some often reasons that I know:

    1. Some uncleared object of class with complex structure (like trees with cross references on parent and its child). So after using that you should call close, destroy or some another method.

    2. Unstatic inner (anonymous) classes in your Activity class - as I understand, inner class always contains reference to its parent, so after finishing activity reference from inner class still exists and GC can't clean them. If you need it in Activity, always create static class (when you want to use refence to YourActivity object, use WeakReference <YourActivty> - it doesn't make a sence for GC and memory leaks doesn't appears, but you should always check for weakReference.get() != null).

    3. References to inner View in your Activity class field. It's better not to use them and always get a reference from findViewByID, but you can just set all this fields to null in onDestroy() method.

    For searching some leaks I used Memory Analysis perspective in Eclipse.

    P.S. Sorry for my english.

    0 讨论(0)
提交回复
热议问题