Questions tagged [leakcanary]
LeakCanary is a memory leak detection library for Android and Java.
366
questions
0
votes
0
answers
8
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-...
5
votes
2
answers
5k
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 ...
23
votes
7
answers
7k
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'
...
0
votes
0
answers
28
views
LeakCanary mContext leaking memory
Now this could be just an issue with reading LeakCanary, but I am having issues fixing a memory leak associated with a widget that I am using. I am on Jelly-Bean, heres the log:
* EXCLUDED LEAK.
* ...
0
votes
0
answers
7
views
My app has two processes, LeakCanary2 is not working
I am using LeakCanary2 in my app which has two processes. One is main process, the other is remote process.
I try to make a leak in main process, but leak canary is not detecting the leak.
4
votes
1
answer
256
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 ...
40
votes
6
answers
44k
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
112
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 ...
0
votes
0
answers
46
views
How to find reason of fragment memory leak? (profiler)
I found a fragment memory leaks with profiler.
PagerFragment has viewpager2 with FragmentStateAdapter
I checked A fragment called onDestroy but memory leak accurs.
How to find which causes memory leak ...
0
votes
0
answers
52
views
i want a regex function for parsing shellcode to get hex address in python
b'%25$lx\n%37$lx\n%27$lx\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
0
votes
1
answer
544
views
How to remove memory leaks in android studio using leak canary
This is my leak stack trace from Leak canary in my android app. I was unable to provide the whole stack trace but here are the ends and begining
┬───
│ GC Root: System class
android.app.ActivityThread$...
1
vote
1
answer
238
views
LeakCanary View.mContext references a destroyed activity (Custom View)
I'm trying to figure out how to resolve my memory leak. I have a CustomActivity, which adds a Fragment that contains a com.example.CustomViewGroup, which has a reference to a com.example.CustomView.
...
3
votes
2
answers
305
views
Sceneform - How to fix leaking SceneView?
I've been using SceneView for loading 3D models for almost a year now but I never understood what caused this leak. I would implement LeakCanary, but just this one leak because I couldn't figure out ...
7
votes
4
answers
10k
views
LeakCanary report leak in InputMethodManager
I am trying to figure it out a leak in my app but I am not sure were this comes from.
LeakCanary is telling me that I can ignore it. Is that right?
01-06 12:04:56.580 6935-9159/com.mypackage D/...
1
vote
0
answers
612
views
app memory leaks likely related to Jetpack Compose and Paging
I recently converted parts of my project to Jetpack Compose I show a list of text items using LazyColumn with data supplied through Pager. But I keep getting lots of warnings from LeakCanary about ...
2
votes
1
answer
1k
views
Leak at zza.zza FirebaseAuthFallbackService
The app works perfectly but in LeakCanary I get a leak every time I close the app or pause it.
I also tried to delete authListener but still the leak remains.
I have tried to solve in many different ...
1
vote
1
answer
70
views
Android leakcanary obfuscate
Confusion can't use leakcanary
LeakCanary plugin has been imported
java.lang.NullPointerException
have integrated Leakcanary for the first time in my app, The trace is generated like the following. ...
0
votes
0
answers
38
views
Memory Leak in DialogFragment
Below is my LeakCanary Memory Leak report.
View LeakCanary report screenshot
Why is my DialogFragment Causing a Memory Leak?
What I did is Called getSupporFragmentManager() on my RMessages.java class ...
0
votes
3
answers
2k
views
Memory leaks while showing toast from other class
I'm using leak canary for detecting memory leaks. From my activity, I'm calling a method from other class for updating data in firebase realtime-database, on addOnCompleteListener() I'm showing a ...
0
votes
0
answers
49
views
Android leakcanary obfuscate plugin error
How to introduce leakcanary plugin?
This is a default new project
have integrated Leakcanary for the first time in my app, The trace is generated like the following. Can someone explain to me what ...
0
votes
1
answer
76
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
87
views
How to fix Dialog Fragment memory leak?
I'm trying to destroy my dialog fragment but after onDestroy is called leakcanary notification is appeared and this log print for me.
I take this error with BottomSheetDialogFragment too.
I'm setting ...
1
vote
1
answer
299
views
RxJava Single - Getting a memory leak, how to correctly unsubscribe?
I'm using RxJava's Single.fromCallable() to wrap around a third party library that makes an API call. I was testing different states on the call, success, failed, low network, no network.
But on the ...
4
votes
0
answers
187
views
Leakcanary - DecorView.mMSActions
I receive a notice from Leakcanary when debugging my app on a Samsung Galaxy S10 running on Android 12.
Indeed, Leakcanary notifies a leaked activity when toggle from light to night mode or vice versa....
0
votes
0
answers
31
views
A leak occurs even though only the default function is used
I used one activity and one accessibility service.
A Leak problem occurs even when only override basic function is used.
It means there is no my business logic and variable in the function.
Is there ...
1
vote
0
answers
36
views
LeakCanary FailAnnotatedTestOnLeakRunListener/@FailTestOnLeak not failing my instrumentation test
Following the guide here, I've added @FailTestOnLeak to my test and FailAnnotatedTestOnLeakRunListener as a listener, everything seem to be working as expected with leaks being found and I've traced ...
0
votes
1
answer
209
views
Android profiler doesn't recognize running device in android studio
I run my app with Android Profiler, but it doesn't show anything in Android Profiler and doesn't recognize the device.
Note :
1 : Android Studio is the latest version
2 : I already checked the "...
2
votes
2
answers
554
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
15
views
What is the meaning of retainedDurationMillis
In LeakCanary, the log shows values for retainedDurationMillis. What is the meaning of this term?
7
votes
2
answers
2k
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 ...
1
vote
1
answer
371
views
Why does Leak Canary detect Google firebase APIs as Leaks?
Why does Leak Canary detect Google firebase APIs as Leaks?
When I launch an app while using firebase, it keeps on detecting memory leaks. Is there a way to stop this? Thanks.
┬───
│ GC Root: Global ...
1
vote
1
answer
423
views
LeakCanary - Leak on destoryView - 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
0
answers
108
views
MediaSession is leaking in audio app with LeakCanary crash
I found a weird leak in my audio application where the audio Service gets leaked if we dismiss the application from the app overview screen (square button or swipe up depending on device). After ...
0
votes
0
answers
46
views
Anonymous class hidden cause leaks
I read a lot that final context inside anonymous class can cause a memory leak.
But on my implementation, when item is clicked, the using of MyActivity.this inside the anonymous implementation can ...
0
votes
2
answers
1k
views
Memory leak with fragments
I am developing an application with single activity. There is main fragment and two fragments inside, here is the code:
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http:...
1
vote
2
answers
436
views
Android UnifiedNativeAds causing Memory leaks
I have a problem with properly destroying Unified Native Ads in a RecyclerView.
I am loading Ads through an AdManager class which holds references of the loaded Ads. I also have a destroy() method in ...
0
votes
1
answer
318
views
Activity leaked after orientation change after using AndroidX Navigation Compose
The MainActivity gets leaked after the second time the orientation changes, but only after navigating to a new destination using the navHostController.
A working project where this can be reproduced ...
0
votes
0
answers
432
views
There is a memory leak in One of My activities due to mLoadedApk. I have used LeakCanary. But not able to understand it
InstagramActivity is First Activity which will visible to user after splashscreen. GetDataFromServer is a singleton which i use for network call using retrofit.
I couldn't understand mLoadedApk and ...
1
vote
1
answer
831
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
27
views
Leakcanary showing BActivity leaked
I use BaseAppManager to record the activitys task stack,add or remove activities in onCreate() and onDestroy() of BaseActivity, but in some cases, memory leaks occur
this is leakcanary picture showing
...
0
votes
0
answers
36
views
AudioManagerAndroid from Agora Rtc Leaking context
The activity which has all instances of RtcEngine, channel etc. is destroyed but LeakCanary still shows that there is a memory leak casued by AudioManagerAndroid which is some internal class to agora ...
1
vote
1
answer
425
views
new Handler().postDelayed(new Runnable() memory leak
Concerning heap problem and memory leaks,
I read the following article that stressed on creating static class for the handler part:
here
Now is the following code prone to heap memory leak or not ?
/...
1
vote
2
answers
273
views
Does LeakCanary has callback?
How can I get the LeakCanary log or any kind data about the leak?
Does LeakCanary has any kind of Callback that we can use to get the "leak data" to do something with it in the time it's happend?
I ...
0
votes
1
answer
164
views
How can I see LeakCanary?
I am trying to solve these leaks. But I have no idea which one is the problem.
1.
┬───
│ GC Root: System class
│
├─ android.os.Looper class
│ Leaking: NO (Thread↓ is not leaking and a class is ...
0
votes
0
answers
64
views
Android studio profiler + leack canary
Android Studio profiler shows leaks but leak canary doesn't show leaks. I test same running app in same device. What is the problem?
50
votes
5
answers
19k
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. ...
0
votes
0
answers
34
views
Why weak references is not recommended by LeakCanary
Quote from LeakCanary doc:
"Memory leaks cannot be fixed by replacing strong references with weak references. It’s a common solution when attempting to quickly address memory issues, however it ...
0
votes
0
answers
87
views
Is this the expected behavior of LeakCanary to automatically "Dump Heap" but not finding any Leaks?
So I installed LeakCanary:
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.7"
When I run the app, go to some detail activity and come back to list activity, it shows ...
0
votes
0
answers
177
views
Leak Canary: How to exactly interpret this memory leak log
Can anyone please guide me on how to interpret the memory from the below-given log?
D/LeakCanary:
D/LeakCanary: ┬───
D/LeakCanary: │ GC Root: Input or output parameters in native code
D/LeakCanary: │...