Questions tagged [leakcanary]
LeakCanary is a memory leak detection library for Android and Java.
366
questions
0
votes
1
answer
17
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
23
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
39
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
70
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.
...
0
votes
0
answers
237
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 ...
0
votes
0
answers
32
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
0
answers
44
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 ...
1
vote
1
answer
53
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
1
answer
41
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 ...
2
votes
2
answers
188
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 ...
0
votes
0
answers
244
views
Leak Canary - service received Service#onDestroy() callback and Service not held by ActivityThread
Leak Canary dumps Service object leakage frequently for custom_service extending WearableListenerService in GMS with following message
package_name.custom_service instance
Leaking: YES (ObjectWatcher ...
0
votes
0
answers
54
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 ...
0
votes
1
answer
305
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$...
0
votes
0
answers
24
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
90
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....
1
vote
0
answers
31
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 ...
1
vote
1
answer
155
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 ...
0
votes
1
answer
123
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
400
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
13
views
What is the meaning of retainedDurationMillis
In LeakCanary, the log shows values for retainedDurationMillis. What is the meaning of this term?
1
vote
1
answer
225
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
95
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
36
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
0
answers
279
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 ...
0
votes
1
answer
281
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
26
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
31
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 ...
0
votes
1
answer
126
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
51
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?
0
votes
0
answers
28
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
49
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
159
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: │...
0
votes
0
answers
23
views
leakcanary-android use error Illegal class file: Class module-info is missing a super type
when i use leakCanary i met the error message below
Illegal class file: Class module-info is missing a super type.
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
0
votes
0
answers
111
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 ...
2
votes
0
answers
313
views
Default Live WallpaperService leaks memory in Android
I'm currently using Android Studio to develop live wallpapers using the wallpaper service.
As a result of the verification, it was found that a memory leak occurs and disappear(?) when the following ...
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 ...
0
votes
0
answers
67
views
How to find the memory leaks for my activity class
I have been working on a big app that has lots of activities and fragments. Recenty we have started to get lots of Out of Memory on our play console for our application.
I have integrated with ...
-1
votes
1
answer
43
views
How to download leakcanary-android aar file
I want to use leakcanary-android aar file and don't want to use grade to download it, how can I do that.
0
votes
1
answer
422
views
Android memory leak in app that uses custom views and ViewBinding on mParent in FrameLayout - LinearLayout
I'm playing around with Android and building this calendar app and now I integrated Leak Canary into it and I'm trying to solve some view leaks. When in my Day View I switch from one day to another I ...
1
vote
0
answers
133
views
Android Leakcanary leak using Flow while no leak using LiveData
If I use Flow, leak canary is showing a leak. Converting that flow to LiveData using asLiveData() there is no leak.
When my app is launched, in a viewmodel I'm doing the following:
itemsRepository
....
5
votes
3
answers
823
views
How to fix memory leak issue in Frame Layout?
I am using leakcanary in my android app and it detects FrameLayout Leaked. But I can't find or fix this issue,
How can I fix this leak? Ref my leak canary report.
FrameLayout Leaked
┬───
│ GC ...
0
votes
1
answer
352
views
How to fix memory leak issue in standard bottom sheet behaviour?
I am using leakcanary and it detects leaks in standard bottom sheet behaviour. But I can't fix this issue,
How can I fix that leak? Ref my leak canary report.
standardBottomSheetBehaviour
┬───
│ ...
2
votes
1
answer
181
views
Spinner is leaking when I have ZERO code inside my Activity
I have zero code inside my MainActivity, only the XML layout I created and the Spinner is leaking, not sure why this is happening or how I can fix this. Does anyone know why? I'm using the LeakCanary ...
1
vote
1
answer
424
views
Toast.mNextView and FrameLayout possible leak - how to trace the cause?
There is a leak in my app and I am not sure where it comes from. I am using Leak Canary to trace the leak but still cannot pinpoint the exact cause.
Any fresh suggestions how to approach the issue ...
0
votes
1
answer
43
views
How to properly ignore objects with expectWeaklyReachable
One of third party SDKs causes memory leaks in my app by keeping references to two different Activities. I am trying to ignore these leaks with expectWeaklyReachable, this is my setup:
This is my ...
3
votes
2
answers
770
views
LoadedApk$ServiceDispatcher.mContext is Leaking
I am getting this leak after several rotation and app being in background. Here is stack trace which I m not able to understand the cause. Also 32474006 bytes retained object is very much. I have 10 ...
1
vote
1
answer
494
views
Android AlertDialog DecorView Memory Leak
When initiating network communication through the Executor class, I use the showProgress function. When the result is received after communication ends, hideProgess function is used. The code is as ...
2
votes
0
answers
205
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 ...
2
votes
1
answer
786
views
How to resolve a memory leak in a custom view?
I'm a newbie to fixing memory leaks and I don't really understand how I should remove them, especially in custom views. In this particular case I have a custom MapLegendView, which is being used in a ...
4
votes
3
answers
554
views
Adding a fragment and calling .replace() causing a memory leak in the added fragment
I have a BottomNavigationView with 3 tabs. On every tab click, it calls .replace()
private void initBottomNavigation() {
mBottomNavigation.setOnNavigationItemSelectedListener(menuItem -> {
...