android tutorial - Detect memory leaks with the leakcanary library in android | Developer android - android app development - android studio - android app developement
Detect memory leaks with the leakcanary library in android
LeakCanary is an Open Source Java library to detect memory leaks in your debug builds. Just add the dependencies in the build.gradle
Then in your Application class:
Now LeakCanary will automatically show a notification when an activity memory leak is detected in your debug build.
NOTE: Release code will contain no reference to LeakCanary other than the two empty classes that exist in the leakcanary-android-no-op dependency.