androidandroid-strictmode

A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks


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 do I look for the leak and what does it mean by " See java.io.Closeable".


Solution

  • 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.

    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).