Qabel / qabel-android

(B2C) :iphone: Android frontend of Qabel
Other
10 stars 17 forks source link

Setup memory leak detection #529

Open audax opened 8 years ago

audax commented 8 years ago

https://github.com/square/leakcanary

Because we leak like the titanic.

jan-schreib commented 8 years ago

When

+    import com.squareup.leakcanary.LeakCanary;
     public void onCreate() {
         super.onCreate();
+        LeakCanary.install(this);
         Log.d(TAG, "onCreate");

and

+    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'

or

+    compile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'

are enough, like shown on the page, than its either not leaking, or not working. I testet in via emulator, more testing may be required.

@audax How did you come to the conclusion that we leak memory? Did you have any OutOfMemory errors?

audax commented 8 years ago

There are references to the MainActivity in the fragments and even in AsyncTasks that sit in OnClickHandlers. There are also some log messages from the system about a leaked activity or service connection.

audax commented 8 years ago

I think there is a little more setup required to find leaking Fragments: https://github.com/square/leakcanary/wiki/FAQ