Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when the map hasn't tiles #46

Open
juancrawford opened this issue May 6, 2021 · 0 comments
Open

Memory leak when the map hasn't tiles #46

juancrawford opened this issue May 6, 2021 · 0 comments

Comments

@juancrawford
Copy link

If the device hasn't internet connection and you launch the place picker and the map is not able to show the tiles and then you go back to the previous activity and press home button LeakCanary detects a memory leak with the following logs:

D/LeakCanary: ====================================
D/LeakCanary: HEAP ANALYSIS RESULT
D/LeakCanary: ====================================
D/LeakCanary: 1 APPLICATION LEAKS
D/LeakCanary: References underlined with "~~~" are likely causes.
D/LeakCanary: Learn more at https://squ.re/leaks.
D/LeakCanary: 942572 bytes retained by leaking objects
D/LeakCanary: Signature: 613b16d4bb1448b8887c13363d15cbfad2ed7
D/LeakCanary: ┬───
D/LeakCanary: │ GC Root: Local variable in native code
D/LeakCanary: │
D/LeakCanary: ├─ com.google.maps.api.android.lib6.gmm6.store.z instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 14.8 kB in 109 objects
D/LeakCanary: │ ↓ k.o
D/LeakCanary: │ ~
D/LeakCanary: ├─ java.util.HashMap instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 968 B in 38 objects
D/LeakCanary: │ ↓ HashMap.table
D/LeakCanary: │ ~~~~~
D/LeakCanary: ├─ java.util.HashMap$Node[] array
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 928 B in 37 objects
D/LeakCanary: │ ↓ HashMap$Node[].[0]
D/LeakCanary: │ ~~~
D/LeakCanary: ├─ java.util.HashMap$Node instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 144 B in 6 objects
D/LeakCanary: │ ↓ HashMap$Node.value
D/LeakCanary: │ ~~~~~
D/LeakCanary: ├─ com.google.maps.api.android.lib6.gmm6.store.j instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 74 B in 2 objects
D/LeakCanary: │ ↓ j.b
D/LeakCanary: │ ~
D/LeakCanary: ├─ com.google.maps.api.android.lib6.gmm6.store.fetch.f instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 12 B in 1 objects
D/LeakCanary: │ ↓ f.a
D/LeakCanary: │ ~
D/LeakCanary: ├─ com.google.maps.api.android.lib6.gmm6.store.fetch.h instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 4.6 kB in 165 objects
D/LeakCanary: │ ↓ h.p
D/LeakCanary: │ ~
D/LeakCanary: ├─ com.google.maps.api.android.lib6.gmm6.vector.gl.g instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 201.3 kB in 84 objects
D/LeakCanary: │ ↓ g.b
D/LeakCanary: │ ~
D/LeakCanary: ├─ com.google.maps.api.android.lib6.gmm6.vector.p instance
D/LeakCanary: │ Leaking: UNKNOWN
D/LeakCanary: │ Retaining 942.6 kB in 4840 objects
D/LeakCanary: │ ↓ p.k
D/LeakCanary: │ ~
D/LeakCanary: ├─ com.google.maps.api.android.lib6.gmm6.api.ac instance
D/LeakCanary: │ Leaking: YES (View detached yet still part of window view hierarchy)
D/LeakCanary: │ Retaining 942.6 kB in 4839 objects
D/LeakCanary: │ View is part of a window view hierarchy
D/LeakCanary: │ View.mAttachInfo is null (view detached)
D/LeakCanary: │ View.mWindowAttachCount = 1
D/LeakCanary: │ mContext instance of Application
D/LeakCanary: │ ↓ View.mParent
D/LeakCanary: ├─ android.widget.FrameLayout instance
D/LeakCanary: │ Leaking: YES (ac↑ is leaking and View detached yet still part of window view hierarchy)
D/LeakCanary: │ Retaining 339.7 kB in 4055 objects
D/LeakCanary: │ View is part of a window view hierarchy
D/LeakCanary: │ View.mAttachInfo is null (view detached)
D/LeakCanary: │ View.mWindowAttachCount = 1
D/LeakCanary: │ mContext instance of Application
D/LeakCanary: │ ↓ View.mParent
D/LeakCanary: ╰→ android.widget.FrameLayout instance
D/LeakCanary: ​ Leaking: YES (ObjectWatcher was watching this because com.google.android.gms.maps.SupportMapFragment received
D/LeakCanary: ​ Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks) and View.mContext
D/LeakCanary: ​ references a destroyed activity)
D/LeakCanary: ​ Retaining 338.6 kB in 4040 objects
D/LeakCanary: ​ key = 4fcc1c3f-5353-48fe-9f2e-fbad8a8b8bbd
D/LeakCanary: ​ watchDurationMillis = 6257
D/LeakCanary: ​ retainedDurationMillis = 1256
D/LeakCanary: ​ View is part of a window view hierarchy
D/LeakCanary: ​ View.mAttachInfo is null (view detached)
D/LeakCanary: ​ View.mID = R.id.map
D/LeakCanary: ​ View.mWindowAttachCount = 1
D/LeakCanary: ​ mContext instance of com.sucho.placepicker.PlacePickerActivity with mDestroyed = true
D/LeakCanary: ====================================
D/LeakCanary: 0 LIBRARY LEAKS
D/LeakCanary: A Library Leak is a leak caused by a known bug in 3rd party code that you do not have control over.
D/LeakCanary: See https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/#4-categorizing-leaks
D/LeakCanary: ====================================
D/LeakCanary: 0 UNREACHABLE OBJECTS
D/LeakCanary: An unreachable object is still in memory but LeakCanary could not find a strong reference path
D/LeakCanary: from GC roots.
D/LeakCanary: ====================================
D/LeakCanary: METADATA
D/LeakCanary: Please include this in bug reports and Stack Overflow questions.
D/LeakCanary: Build.VERSION.SDK_INT: 29
D/LeakCanary: Build.MANUFACTURER: samsung
D/LeakCanary: LeakCanary version: 2.6
D/LeakCanary: App process name:
D/LeakCanary: Count of retained yet cleared: 5 KeyedWeakReference instances
D/LeakCanary: Stats: LruCache[maxSize=3000,hits=5445,misses=89253,hitRate=5%]
D/LeakCanary: RandomAccess[bytes=4476463,reads=89253,travel=36504407735,range=25401539,size=30684876]
D/LeakCanary: Heap dump reason: 8 retained objects, app is not visible
D/LeakCanary: Analysis duration: 9558 ms
D/LeakCanary: Heap dump timestamp: 1620266662631
D/LeakCanary: Heap dump duration: 2673 ms
D/LeakCanary: ====================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant