0

(standard input):10240:D/LeakCanary( 4167): * GC ROOT thread com.apsalar.sdk.ApsalarThread. (named 'ApsalarHTTPThread') (standard input):10241:D/LeakCanary( 4167): * leaks .MainActivity instance (standard input):10243:D/LeakCanary( 4167): * Device: samsung samsung GT-S7562 kylexx (standard input):10244:D/LeakCanary( 4167): * Android Version: 4.0.4 API: 15 LeakCanary: 1.3.1 (standard input):10245:D/LeakCanary( 4167): * Durations: watch=5023ms, gc=829ms, heap dump=9032ms, analysis=47771ms

Does above log says that Apsalar thread is the reason for memory leaks ?

1 Answers1

0

ApsalarHTTPThread thread has a reference to MainActivity while ApsalarHTTPThread thread is running, even if you have finished your MainActivity.

You can try getApplicationContext() instead of MainActivity.this.

kkyr
  • 3,785
  • 3
  • 29
  • 59
wanglugao
  • 281
  • 2
  • 10