Open Bug 1935182 Opened 3 months ago Updated 1 month ago

Memory leak: AwesomeBarWrapper is leaking in SearchDialogFragment

Categories

(Fenix :: Search, defect)

All
Android
defect

Tracking

(Not tracked)

People

(Reporter: segun, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

Crash Data

User Agent: Mozilla/5.0 (Android 15; Mobile; rv:135.0) Gecko/135.0 Firefox/135.0

Leak signatures

  1. baa8adaa2f0b3448a00fc2ac028fb4f4db9452b7
  2. 985005fccaea04494f5121553bf267712abf3eed

Leak trace

====================================
HEAP ANALYSIS RESULT
====================================
2 APPLICATION LEAKS

References underlined with "~~~" are likely causes.
Learn more at https://squ.re/leaks.

123113 bytes retained by leaking objects
Signature: baa8adaa2f0b3448a00fc2ac028fb4f4db9452b7
┬───
│ GC Root: Global variable in native code
│
├─ dalvik.system.PathClassLoader instance
│	Leaking: NO (SnapshotKt↓ is not leaking and A ClassLoader is never leaking)
│	↓ ClassLoader.runtimeInternalObjects
├─ java.lang.Object[] array
│	Leaking: NO (SnapshotKt↓ is not leaking)
│	↓ Object[2951]
├─ androidx.compose.runtime.snapshots.SnapshotKt class
│	Leaking: NO (a class is never leaking)
│	↓ static SnapshotKt.applyObservers
│                    	~~~~~~~~~~~~~~
├─ java.util.ArrayList instance
│	Leaking: UNKNOWN
│	Retaining 88 B in 5 objects
│	↓ ArrayList[0]
│           	~~~
├─ androidx.compose.runtime.Recomposer$recompositionRunner$2$unregisterApplyObserver$1 instance
│	Leaking: UNKNOWN
│	Retaining 16 B in 1 objects
│	Anonymous subclass of kotlin.jvm.internal.Lambda
│	↓ Recomposer$recompositionRunner$2$unregisterApplyObserver$1.this$0
│                                                             	~~~~~~
├─ androidx.compose.runtime.Recomposer instance
│	Leaking: UNKNOWN
│	Retaining 1.8 MB in 6571 objects
│	↓ Recomposer.snapshotInvalidations
│             	~~~~~~~~~~~~~~~~~~~~~
├─ androidx.collection.MutableScatterSet instance
│	Leaking: UNKNOWN
│	Retaining 1.8 MB in 6553 objects
│	↓ ScatterSet.elements
│             	~~~~~~~~
├─ java.lang.Object[] array
│	Leaking: UNKNOWN
│	Retaining 1.8 MB in 6551 objects
│	↓ Object[1]
│        	~~~
├─ androidx.compose.runtime.ParcelableSnapshotMutableState instance
│	Leaking: UNKNOWN
│	Retaining 421.6 kB in 6496 objects
│	↓ SnapshotMutableStateImpl.next
│                           	~~~~
├─ androidx.compose.runtime.SnapshotMutableStateImpl$StateStateRecord instance
│	Leaking: UNKNOWN
│	Retaining 421.5 kB in 6494 objects
│	↓ SnapshotMutableStateImpl$StateStateRecord.value
│                                            	~~~~~
├─ java.util.ArrayList instance
│	Leaking: UNKNOWN
│	Retaining 421.5 kB in 6492 objects
│	↓ ArrayList[0]
│           	~~~
├─ mozilla.components.feature.awesomebar.provider.SearchTermSuggestionsProvider instance
│	Leaking: UNKNOWN
│	Retaining 16.0 kB in 4 objects
│	↓ SearchTermSuggestionsProvider.searchUseCase
│                                	~~~~~~~~~~~~~
├─ org.mozilla.fenix.search.awesomebar.AwesomeBarView$historySearchTermUseCase$1 instance
│	Leaking: UNKNOWN
│	Retaining 12 B in 1 objects
│	Anonymous class implementing mozilla.components.feature.search.SearchUseCases$SearchUseCase
│	↓ AwesomeBarView$historySearchTermUseCase$1.this$0
│                                            	~~~~~~
├─ org.mozilla.fenix.search.awesomebar.AwesomeBarView instance
│	Leaking: UNKNOWN
│	Retaining 123.6 kB in 2366 objects
│	activity instance of org.mozilla.fenix.HomeActivity with mDestroyed = false
│	↓ AwesomeBarView.view
│                 	~~~~
├─ org.mozilla.fenix.search.awesomebar.AwesomeBarWrapper instance
│	Leaking: YES (View detached yet still part of window view hierarchy)
│	Retaining 123.1 kB in 2353 objects
│	View is part of a window view hierarchy
│	View.mAttachInfo is null (view detached)
│	View.mWindowAttachCount = 1
│	mContext instance of android.view.ContextThemeWrapper, wrapping activity org.mozilla.fenix.HomeActivity with mDestroyed = false
│	↓ View.mParent
╰→ org.mozilla.fenix.perf.SearchDialogFragmentConstraintLayout instance
​ 	Leaking: YES (ObjectWatcher was watching this because org.mozilla.fenix.search.SearchDialogFragment received Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks) and View detached yet still part of window view hierarchy)
​ 	Retaining 30.0 kB in 549 objects
​ 	key = 360ff845-caa7-48ad-845d-293845273c0f
​ 	watchDurationMillis = 8193
​ 	retainedDurationMillis = 3193
​ 	View is part of a window view hierarchy
​ 	View.mAttachInfo is null (view detached)
​ 	View.mWindowAttachCount = 1
​ 	mContext instance of android.view.ContextThemeWrapper, wrapping activity org.mozilla.fenix.HomeActivity with mDestroyed = false

4203 bytes retained by leaking objects
Signature: 985005fccaea04494f5121553bf267712abf3eed
┬───
│ GC Root: Global variable in native code
│
├─ dalvik.system.PathClassLoader instance
│	Leaking: NO (SnapshotKt↓ is not leaking and A ClassLoader is never leaking)
│	↓ ClassLoader.runtimeInternalObjects
├─ java.lang.Object[] array
│	Leaking: NO (SnapshotKt↓ is not leaking)
│	↓ Object[2951]
├─ androidx.compose.runtime.snapshots.SnapshotKt class
│	Leaking: NO (a class is never leaking)
│	↓ static SnapshotKt.applyObservers
│                    	~~~~~~~~~~~~~~
├─ java.util.ArrayList instance
│	Leaking: UNKNOWN
│	Retaining 88 B in 5 objects
│	↓ ArrayList[0]
│           	~~~
├─ androidx.compose.runtime.Recomposer$recompositionRunner$2$unregisterApplyObserver$1 instance
│	Leaking: UNKNOWN
│	Retaining 16 B in 1 objects
│	Anonymous subclass of kotlin.jvm.internal.Lambda
│	↓ Recomposer$recompositionRunner$2$unregisterApplyObserver$1.this$0
│                                                             	~~~~~~
├─ androidx.compose.runtime.Recomposer instance
│	Leaking: UNKNOWN
│	Retaining 1.8 MB in 6571 objects
│	↓ Recomposer.snapshotInvalidations
│             	~~~~~~~~~~~~~~~~~~~~~
├─ androidx.collection.MutableScatterSet instance
│	Leaking: UNKNOWN
│	Retaining 1.8 MB in 6553 objects
│	↓ ScatterSet.elements
│             	~~~~~~~~
├─ java.lang.Object[] array
│	Leaking: UNKNOWN
│	Retaining 1.8 MB in 6551 objects
│	↓ Object[1]
│        	~~~
├─ androidx.compose.runtime.ParcelableSnapshotMutableState instance
│	Leaking: UNKNOWN
│	Retaining 421.6 kB in 6496 objects
│	↓ SnapshotMutableStateImpl.next
│                           	~~~~
├─ androidx.compose.runtime.SnapshotMutableStateImpl$StateStateRecord instance
│	Leaking: UNKNOWN
│	Retaining 421.5 kB in 6494 objects
│	↓ SnapshotMutableStateImpl$StateStateRecord.value
│                                            	~~~~~
├─ java.util.ArrayList instance
│	Leaking: UNKNOWN
│	Retaining 421.5 kB in 6492 objects
│	↓ ArrayList[8]
│           	~~~
├─ mozilla.components.feature.awesomebar.provider.SearchEngineSuggestionProvider instance
│	Leaking: UNKNOWN
│	Retaining 16.1 kB in 6 objects
│	context instance of org.mozilla.fenix.HomeActivity with mDestroyed = false
│	↓ SearchEngineSuggestionProvider.selectShortcutEngine
│                                 	~~~~~~~~~~~~~~~~~~~~
├─ org.mozilla.fenix.search.awesomebar.AwesomeBarView$3 instance
│	Leaking: UNKNOWN
│	Retaining 40 B in 1 objects
│	Anonymous subclass of kotlin.jvm.internal.FunctionReferenceImpl
│	↓ CallableReference.receiver
│                    	~~~~~~~~
├─ org.mozilla.fenix.search.SearchDialogInteractor instance
│	Leaking: UNKNOWN
│	Retaining 168 B in 7 objects
│	↓ SearchDialogInteractor.searchController
│                         	~~~~~~~~~~~~~~~~
├─ org.mozilla.fenix.search.SearchDialogController instance
│	Leaking: UNKNOWN
│	Retaining 156 B in 6 objects
│	activity instance of org.mozilla.fenix.HomeActivity with mDestroyed = false
│	↓ SearchDialogController.clearToolbar
│                         	~~~~~~~~~~~~
├─ org.mozilla.fenix.search.SearchDialogFragment$onCreateView$5 instance
│	Leaking: UNKNOWN
│	Retaining 16 B in 1 objects
│	Anonymous subclass of kotlin.jvm.internal.Lambda
│	↓ SearchDialogFragment$onCreateView$5.this$0
│                                      	~~~~~~
╰→ org.mozilla.fenix.search.SearchDialogFragment instance
​ 	Leaking: YES (ObjectWatcher was watching this because org.mozilla.fenix.search.SearchDialogFragment received Fragment#onDestroy() callback. Conflicts with Fragment.mLifecycleRegistry.state is INITIALIZED)
​ 	Retaining 4.2 kB in 108 objects
​ 	key = 87322446-cf3b-43e9-8fd4-355755eddbbe
​ 	watchDurationMillis = 8189
​ 	retainedDurationMillis = 3187

The severity field is not set for this bug.
:skhan, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(skhan)
You need to log in before you can comment on or make changes to this bug.