Questions tagged [leakcanary]

LeakCanary is a memory leak detection library for Android and Java.

LeakCanary is a memory leak detection library for and .

For more information, see the GitHub page.

390 questions
50
votes
5 answers

Leak canary, Recyclerview leaking mAdapter

I decided it was high time I learned how to use Leak Canary to detect Leaks within my apps, and as I always do, I tried to implement it in my project to really understand how to use the tool. Implementing it was easy enough, the difficult part was…
frankelot
  • 13,666
  • 16
  • 54
  • 89
45
votes
1 answer

Could Navigation Arch Component create a false positive memory leak?

I have a basic knowledge of memory leaks and what can cause them. That's why I don't understand if I have a problem in my code or is it a false positive. I don't know which part of the code I should share since the project is not small. But just let…
43
votes
6 answers

How to use Leak Canary

I am currently experiencing an OutOfMemoryError in my apps. I have tried to debug using MAT, but it is still too hard to find the leak in a few activities. Then I found LeakCanary, which seems simpler and easier to use, however I could not find any…
Charas
  • 1,753
  • 4
  • 21
  • 53
31
votes
2 answers

Stuck at "Dumping memory, app will freeze. Brrr." message

I'm trying to use LeakCanary to detect memory leaks in my app, but it does not go further than the message "Dumping memory, app will freeze. Brrr." I've been waiting for about 20 minutes or so, but no changes. Same behaviour on these devices: 1.…
Sergey Maslov
  • 758
  • 1
  • 8
  • 22
24
votes
7 answers

Square LeakCanary Cannot find symbol

build.gradle has been configured as per github insturctions.LeakCanary class doesn't seem to be included. dependencies { debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3' releaseCompile…
WenChao
  • 3,586
  • 6
  • 32
  • 46
20
votes
4 answers

Memory leak in Fragment

I am using the LeakCanary library to monitor memory leaks in my app. I received this memory leak and not sure how to track down what is causing it. 05-09 09:32:14.731 28497-31220/? D/LeakCanary﹕ In com.etiennelawlor.minesweeper:0.0.21:21. *…
Etienne Lawlor
  • 6,817
  • 18
  • 77
  • 89
18
votes
4 answers

Leak Canary detects memory leaks for TabLayout with ViewPager2

I followed the official documentation to setup a TabLayout with ViewPager2. I used the TabLayoutMediator this way to connect the TabLayout with the ViewPager2: TabLayoutMediator(binding.tabLayout, binding.viewPager) { tab, position -> …
iClaude
  • 707
  • 8
  • 14
17
votes
3 answers

MainActivity leaked using leakcanary

I am using Leak Canary to track memory leak and it says the following were leaked: static hk.o references ht.a leaks MainActivity instance what is the hk.o and ht.a? I dont have them in my MainActivity.
Nicolas
  • 291
  • 1
  • 7
17
votes
5 answers

ConnectivityManager leaking, not sure how to resolve

So, I have this method that let's me know if the user has an active internet connection. It works well. However, leak canary has identified a memory leak associated with the connectivityManager. I am presently not closing the connectivityManager…
seekingStillness
  • 4,833
  • 5
  • 38
  • 68
16
votes
2 answers

NullPointerException from LeakCanary when running Robolectric tests

Added LeakCanary (1.3) to my Application: @Override public void onCreate() { super.onCreate(); Fabric.with(this, new Crashlytics()); LeakCanary.install(this); When I run the Robolectric test suite for my application I get a…
erafn
  • 191
  • 7
12
votes
1 answer

LeakCanary received Fragment#onDestroy() callback and Fragment#mFragmentManager is null

I am trying to fix the memory leak using the LeakCanary and honestly, I can't understand the stack trace that was showing me. I am using a firebase paging option and stop the listening on the onDestroy method. I also did not pass any activity or…
Mr. Baks
  • 297
  • 2
  • 6
  • 20
12
votes
1 answer

android.support.constraint.ConstraintLayout has leaked:

I'm using LeakCanary to detect memory leaks in an app. I successfully identified and fixed some leaks using it, but I am struggling find the root of this leak: * android.support.constraint.ConstraintLayout has leaked: * Toast$TN.mNextView * ↳…
SebRut
  • 585
  • 4
  • 22
11
votes
1 answer

Memory Leak at Toast$TN.mNextView

I add leak canary to my app and I find this memory leak: https://i.stack.imgur.com/fAtxe.png I don't use at my MainActivity LinearLayout or Toast but I has this leak and I can't understand why and how. Maybe it because I use toasts and linear layout…
Vlad Kramarenko
  • 266
  • 3
  • 18
11
votes
1 answer

How to treat memory leaks using the new AndroidProfiler

I'm trying to learn how to identify and treat memory leaks in my App. I'm reading this great article, but I'm a bit confused about how to apply that in the new "Android Profiler" tool, that came with Android Studio 3.0. I'have a test application and…
11
votes
2 answers

Is my leakcanary working? How to know?

I believe to have successfully installed LeakCanary. I added the debug, release, and test dependencies to the build.gradle file. I added the necessary files to my Application Class. Imported as necessary. Confirmed the application class is…
seekingStillness
  • 4,833
  • 5
  • 38
  • 68
1
2 3
25 26