Questions tagged [leakcanary]
LeakCanary is a memory leak detection library for Android and Java.
390
questions
0
votes
1
answer
448
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 ...
0
votes
0
answers
20
views
How to set AdListener to null
I have a banner ad and its callbacks that I display but when I finish the activity LeakCanary shows a memory leak:
com.android.gms,ads.nonagon.ad.webview
Leaking: YES (View.mContext references a ...
0
votes
0
answers
56
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) }
...
4
votes
1
answer
473
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 ...
0
votes
0
answers
33
views
How can I find fs_base in gdb?
I'm studying about master canary these days and I want to know where exactly fs:0x28 is.
Is there any way to access to fs_base instead of using $fs_base command? (My gdb is outdated so I can't use the ...
1
vote
0
answers
144
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
43
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
4k
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
133
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
41
views
Android Studio - How can I turn off leak canary for UI test automation builds (not unit tests)
So I need to turn off leak canary for UI test automation builds. I followed documentation on official website for leak canary but it was not that helpful.
I had this implementation on build.gradle(:...
0
votes
0
answers
15
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 ...
0
votes
0
answers
32
views
How to use Leakcanary for Service (like InputMethodService)
My application is Keyboard IME Service, with some UI for config and testing.
D/LeakCanary: LeakCanary is currently disabled: Waiting for debugger to detach. comes first.
Then
D/LeakCanary: Watching ...
0
votes
0
answers
10
views
How can I customize garbage collection in LeakCanary 2.10?
I'd like to use more thorough garbage collection than the LeakCanary default, prior to marking an object detained. This seemed to help with avoiding spurious Service-related leaks in earlier ...
0
votes
0
answers
89
views
LeakCanary RenderNodeAnimator instance memory leak
On my app, when I change theme, I get an instant memory leak notification from LeakCanary. The code I use to change theme:
fun execute(isDark: Boolean){
if (isDark) {
AppCompatDelegate....
0
votes
0
answers
46
views
Memory Leaks in Android - Fast Pace App Usage
I am currently developing an app and I am encountering some memory leak issues. I am using leak canary to detect them. My problem is, when I use the app like a normal human would o, leak canary ...
0
votes
0
answers
136
views
JobInfoSchedulerService Leaked
use google firebase implementation 'com.google.android.datatransport:transport-runtime:3.1.8',when i open my app i find this leaked:
====================================
HEAP ANALYSIS RESULT
==========...
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
640
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
229
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
87
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
450
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
137
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 ...
0
votes
0
answers
60
views
Memory-Leak or LeakCanary Bug
Here’s the situation:
I’m using Navigation component, Airbnb Epoxy, TwoPaneSlidnig,
Databinding and MVVM architecture
I have one Activity, few Fragments, two Navhost (one for detail-pane
and the main ...
0
votes
1
answer
201
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 ...
0
votes
0
answers
17
views
maven dependency downlaoded for leakcanary shark but jar's not getting added to intellij ide classpath
I have maven project where i have downloaded below dependency
<dependency>
<groupId>com.squareup.leakcanary</groupId>
<artifactId>shark</artifactId>
<...
3
votes
3
answers
1k
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 ...
0
votes
0
answers
62
views
Fragment leaks whenever I replace it with a new fragment in android studio (Java) leak canary
I still don't how to ask in stack but I hope you guys can understand my problem , I have been struggling to solve this leak that happens to me , I have a splash fragment that its only job is to show a ...
0
votes
0
answers
112
views
Leak canary memory leak
How to fix this memory leak?
The log is generated when closing an activity. There is AutoLogoutColumn class that wraps content and logs out the app when it is idle for a while. Its reporting ...
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
486
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
0
answers
49
views
How resolve the memory leak due to TextToSpeech?
android.speech.tts.TextToSpeech$Connection$1 instance
│ Leaking: UNKNOWN
│ Retaining 3.6 MB in 5653 objects
│ Anonymous subclass of android.speech.tts.ITextToSpeechCallback$Stub
...
0
votes
1
answer
185
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
0
answers
37
views
Leak Canary SemClipboardManager - android
My device is samsung VERSION.SDK_INT: 24 and get me bellow leak, How can I resolve this?
GC Root: Global variable in native code
com.samsung.android.content.clipboard.SemClipboardManager$2 instance
...
0
votes
1
answer
400
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
83
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
211
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 ...
0
votes
0
answers
67
views
How to integrate leak canary to AOSP system app? such as Launcher
I tried to add all aar and jar through java_import and android_library_import to Launcher3, but the error is as follows:
11-22 18:56:43.965 18825 18825 E AndroidRuntime: java.lang.NoClassDefFoundError:...
-1
votes
1
answer
97
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
0
votes
0
answers
128
views
Detect memory leak using leakcanary 2 in singleton class/ normal java class in android
I followed the official Documentation for creating a app that detects leaks in android app using LeakCanary2. By adding the following line of code in build.gradle file.
debugImplementation 'com....
0
votes
1
answer
827
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
17
views
package leakcanary does not exist
My issue is that I used the LeakCanary library in android. com.squareup.leakcanary:leakcanary-android:2.9.1, here my code runs and works successfully in debug mode, but when I create a release, then ...
1
vote
2
answers
344
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
223
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
426
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
382
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
1k
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
305
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 ...
50
votes
5
answers
22k
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. ...
8
votes
2
answers
9k
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 ...