Skip to main content
Filter by
Sorted by
Tagged with
8 votes
2 answers
5k views

Can't use LeakCanary because of org.junit.Test class dependency in external libraries

I'm trying to use LeakCanary for finding memory leaks in my Android application. I'm using Android Studio. When I start debugging my application I see "LeakCanary is currently disabled: test ...
3 votes
1 answer
2k views

LeakCanary - Leak on destroyView - what does it mean?

I'm using leakCanary in my debug app and every time my fragment is destroyed, I'm getting a leak warning. the leak tree starts with saying that there's no leak in the Fragment, only this part is ...
1 vote
1 answer
446 views

ComposeView leak: ViewTreeObserver.OnGlobalLayoutListener leaking even if it is removed during onDispose

So I have this Composable that I use to detect if a keyboard is visible: @Composable fun keyboardVisibilityAsState(): State<Boolean> { val keyboardState = remember { mutableStateOf(false) } ...
0 votes
1 answer
1k views

How to use Leak Canary on Android TV

I have an Android TV app which is pre-Lollipop which I need to check for leaks. I have added Leak Canary to the application and am able to run the app and see the leak canary logo briefly when the ...
0 votes
0 answers
52 views

It is not possible to capture specific web links. Unexpected behavior in my Android browser app

I have created a minimal version to check this error. The app declares in its manifest.xml an activity-alias that points to the only activity of the app, Manifest.xml: <?xml version="1.0" ...
0 votes
0 answers
113 views

AutofillClientController leaking activity: system leak or is it my implementation?

When rotating the emulator the memory leak below pops up. I'm not able to figure out exactly where it comes from. To me it looks like the systems AutofillClientController is leaking my ExampleActivity....
2 votes
2 answers
2k views

BottomSheetDialogFragment shows a memory leak, in LeakCanary 2, but I'm not sure why?

I've been looking through a number of posts and I have not found anything to help me understand why LeakCanary is reporting a leak. I have a main activity with a com.google.android.material....
0 votes
1 answer
327 views

Memory Leak After Upgrading Ads Library For Android

I have upgraded the ads library to the following today: implementation 'com.google.android.gms:play-services-ads:21.5.0' I'm using Interstitial Ads only. Now, I'm getting the following memory leak as ...
3 votes
0 answers
80 views

Detecting multiple instances of a custom object via LeakCanary

As per the docs, looks like LeakCanary only provides information about leaked object. But, I am also interested in finding multiple instances of certain custom HeavyWeightObject objects. Can ...
0 votes
0 answers
33 views

INSTALL_PARSE_FAILED_MANIFEST_MALFORMED error in Android Studio

I changed the API targeting of my app to 33 and when I try to run it I get this error: This is my manifest.xml file: <?xml version="1.0" encoding="utf-8"?> <manifest ...
1 vote
2 answers
1k views

Rewarded ads memory leak admob

I am super new to android coding, please tell me if this memory leak is significant enough for me to get worried. And if so please suggest something i can do about it. I am trying to use admob to show ...
0 votes
0 answers
61 views

Lots of duplicate classes for com.squareup.leakcanary:leakcanary-android:2.12

I am using leakcanary: // debugImplementation because LeakCanary should only run in debug builds. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12' Building the app generates lots ...
0 votes
0 answers
34 views

Leak canary showing leak in fragment root layout while using webview in item of viewpager2

I am using webview as a view in item of viewpager 2 when i am browsing the app the memory usage in profiler reaches 1gb very soon currently using best practices on viewbinding. code-> @...
1 vote
2 answers
1k views

I'm getting a native crash in my application. This crash is frequent in the release build and has never occurred in debug

I tried looking into the systrace in Perfetto UI but just couldn't figure out the reason for crash. The logs for the crashes showed multiple calls related to the G.C so suspected it to be a memory ...
0 votes
1 answer
62 views

How to prevent leaking Fragment

I have the following Activity: class SwitchFragAct extends AppCompatActivity { Fragment a; Fragment b; onClickSwitchFrags(View v) { FragmentManager mgr = getSupportFragmentManager(); ...
0 votes
0 answers
105 views

Can we identify the line number responsible for memory leaks in an Android app?

I'm trying to find the line number causing a memory leak in an Android app. Is there a way to pinpoint the exact line? I have tried using LeakCanary library to find the memory leaks in the Android app....
6 votes
1 answer
2k views

Google Maps MapsView leaking

I´ve added a Google Maps MapView to a Fragment in Android. Until now it is a clear Map without any Markers, Options or anything else. Nevertheless whenever I leave the Fragment the app has a memory ...
1 vote
1 answer
785 views

LeakCanary is currently disabled caused by leakcanary.LeakAssertions was found in classpath

I have been trying to add LeakCanary to my codebase. I've read the instructions from the Getting started where I also found out that LeakCanary has a test environment detection and I should add the ...
4 votes
1 answer
599 views

WebRtcAudioRecord.context is leaking reported by leak canary. How to solve?

My webrtc Android native application has issue with WebRtcAudioRecord.context. Leak canary is continuously reporting that WebRtcAudioRecord.class is leaking memory. I do dispose my webrtc components ...
1 vote
0 answers
347 views

Leak canary detecting leaks but I dont know how the leak is occuring

I am getting the following leak from leak canary. But I dont know what is the reason. I also cannot replicate the leak.. The leak occurs randomly so I am not able to trace the leak. Here, I get leak ...
0 votes
0 answers
190 views

How to figure out where canary and return address are located?

I have this code gave me from my professor, he also wrote other versions of the same software going to uncomment parts of code in order to show us how a stack works but I don't really understand. #...
17 votes
5 answers
5k views

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 ...
1 vote
3 answers
680 views

ConnectivityManager Callback Memory Leak - Android

I'm using LeakCanary and it found a memory leak in ConnectivityManager. I've never used ConnectivityManager before and it's not in my project from anything that I wrote. I'm assuming maybe a 3rd party ...
0 votes
0 answers
21 views

Custom back press handler causes mem leak

have registered custom back press with handler onCreate in fragment. But leak canary tells there is memory leak when the fragment gets destroyed. This is on back press implementation called on ...
5 votes
2 answers
2k views

How can I exclude a class from LeakCanary?

I'm doing this: ExcludedRefs excludedRefs = AndroidExcludedRefs.createAppDefaults() .clazz("androidx.lifecycle.ReportFragment") .reason("Very annoying report fragment ...
0 votes
1 answer
2k views

received Activity#onDestroy() callback and Activity#mDestroyed is true - Android

How can I resolve this leak? ┬─── │ GC Root: Global variable in native code │ ├─ com.samsung.android.content.clipboard.SemClipboardManager$2 instance │ Leaking: UNKNOWN │ Retaining 204.4 kB in ...
1 vote
1 answer
418 views

Activity with Navigation component cause A Memory Leak after Start New Root Activity or Calling Finish()

My app start with this Activity _ A _ Which has FragmentContainer that get initialized as following <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/...
0 votes
1 answer
128 views

AndroidJUnitRunner cannot find extra class com.squareup.leakcanary.FailTestOnLeakRunListener

I am trying to run leak canary along with my Android Instrumentation tests. I followed the LeakCanary documentation https://square.github.io/leakcanary/upgrading-to-leakcanary-2.0/#running-leakcanary-...
2 votes
1 answer
1k views

Android - Leakcanary spot memory leak in Activities using Android webview - Problem identified in Samsung Android 13 (One ui 5)

folks Using leakcanary tool we have noticed recently memory leaks in activities that use webview. The issue just occurs in some models like Samsung devices with Android 13 (one ui 5). We were not able ...
0 votes
1 answer
596 views

Fragment Memory Leak during FragmentTransaction Android Studio

I am using LeakCanary to monitor memory leaks in my mobile app in Android Studio. They were found in an activity that makes a FragmentTransaction operation with two Fragments. They are both ...
3 votes
3 answers
2k views

Memory Leak in MessageQueue in android?

I am having a memory leak in my MainActivity.java which was detected by LeakCanary. This is my Leak Trace. ┬─── │ GC Root: Input or output parameters in native code │ ├─ android.os.MessageQueue ...
3 votes
2 answers
2k views

How to ignore certain classes from LeakCanary?

Can someone give me a working example of how to ignoring certain classes from LeakCanary? I was looking at this example for ignoring certain classes from third party library in LeakCanary, but I ...
0 votes
1 answer
1k views

Memory Leaking Android

Do you guys have any suggestion what can cause this memory leak that I got from the Leak Canary? Below is the description I am getting from the report. Steps to reproduce are, In the Settings menu, ...
0 votes
1 answer
429 views

I get this report from leak canary, how can I fix the problems identified

This is the output from leak canary after running the app. Th code below is the standard log output from leak canary and the references are based on the current app that uses exoplayer to play mp3 ...
0 votes
1 answer
805 views

LeakCanary is currently disabled: test class org.junit.Test was found in classpath

I added LeakCanary library to my project and i got this error message : LeakCanary is currently disabled: test class org.junit.Test was found in classpath. I found an answer which include this code ...
1 vote
0 answers
109 views

How to handle an interface leak from leak canary?

I keep getting this leak in the canary about the interface from SubroutineParentItemAdapter Class wherein used in Subroutine Fragment. I do not understand how SubroutineParentItemAdapter....
0 votes
1 answer
418 views

LeakCanary not installed in launcher

I did the change as suggested in app:build.gradle -> debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1' But when i pushed my apk, then i cannot see the Leak Canary in my ...
-1 votes
1 answer
157 views

Can I integrate leak canary to AOSP build system?

Can i add leak canary aar to Android.mk dependency and use leak canary as part of system app
1 vote
2 answers
559 views

lifecycle SavedStateHandlesVM instance memory leak in fragment

I have a fragment which gets data from an api, When i navigate to any other fragment i get this memory leak and I am using the LeakCanary library to monitor memory leaks in my app. I received this ...
3 votes
0 answers
262 views

Activity's LiveData leaking a Fragment

I am currently "Leak hunting" within my app and noticed some strange reports from LeakCanary. I have a LiveData field named appBarVerticalOffset within my Activity and a child Fragment who ...
0 votes
1 answer
526 views

Using LeakCanary with HPROF File?

Short Question: Is it somehow possible to use the LeakCanary library with just the HPROF File and find leaks that way? I already tried different stuff but failed as I dont have a KeyedWeakReference. ...
0 votes
1 answer
941 views

Memory leak in LeakCanary for Android

Below are the logs I got through Leak Canary. I am new to this and I am not sure what exactly is the issue here. Can you please help me how can I fix the same. ├─ android.app.AppOpsManager$3 instance │...
1 vote
2 answers
2k views

Android MainActivity Data Leak after Changing app to Darkmode

I have a basic android app for now, where there's 2 fragments they are showing text only and 1 bottom navigation bar The app checks if the default mode is Darkmode or no so i can update my design... ...
2 votes
0 answers
429 views

Details Activity leaked due to interstitial ad and some objects

In this app, I implemented an Admob interstitial ad in one activity, it should appeared after two clicks / entered the activity, Leak canary shows this ad causes a leak the leak canary debug details ...
51 votes
5 answers
23k views

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. ...
9 votes
2 answers
11k views

Disable Leak Canary temporarily from Debug apps

I am using leak canary to detect potential leaks in my Android application. But when I was developing feature , it is quite disturbing as it starts taking heap dumps time to time. I am using it in ...
3 votes
2 answers
2k views

Memory leak when removing location update from a fragment in onPause

In one of the fragments in my app, I require location updates in order to determine when the user is near a short list of locations so relevant information is available to the user. When I create a ...
25 votes
7 answers
8k views

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' ...
44 votes
6 answers
50k views

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 ...
2 votes
1 answer
2k views

ExternalSyntheticLambda1 Leak Canary

I'm using LeakCanary to detect leaks in the app I'm working on. And I have no idea where this one comes from. What might ExternalSyntheticLambda1 refer to? I used binding first, and I decided to ...

1
2 3 4 5
8