Comments (7)
Reproduced the leak and root caused it: https://bugs.chromium.org/p/chromium/issues/detail?id=1499154
from leakcanary.
The following leak is happening on google pixel A4 and Android 13
┬───
│ GC Root: Global variable in native code
│
├─ WV.H5 instance
│ Leaking: UNKNOWN
│ Retaining 61,3 kB in 1123 objects
│ ↓ H5.c
│ ~
├─ org.chromium.android_webview.AwContents instance
│ Leaking: UNKNOWN
│ Retaining 61,3 kB in 1122 objects
│ e instance of WV.Rc, wrapping activity it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false
│ ↓ AwContents.c
│ ~
├─ it.jannax.base.view.NestedScrollWebView instance
│ Leaking: UNKNOWN
│ Retaining 56,5 kB in 998 objects
│ View not part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.webView
│ View.mWindowAttachCount = 1
│ mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false
│ ↓ View.mParent
│ ~~~~~~~
├─ android.widget.RelativeLayout instance
│ Leaking: UNKNOWN
│ Retaining 52,2 kB in 943 objects
│ View not part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.container
│ View.mWindowAttachCount = 1
│ mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false
│ ↓ View.mParent
│ ~~~~~~~
├─ android.widget.FrameLayout instance
│ Leaking: UNKNOWN
│ Retaining 11,4 kB in 163 objects
│ View not part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.content
│ View.mWindowAttachCount = 1
│ mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false
│ ↓ View.mParent
│ ~~~~~~~
╰→ android.widget.LinearLayout instance
Leaking: YES (ObjectWatcher was watching this because it.jannax.game.solitaire.fragment.CardFragment received
Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks))
Retaining 10,1 kB in 148 objects
key = 82f3abce-e1be-4a3c-9dad-0d337d8adab1
watchDurationMillis = 5625
retainedDurationMillis = 624
View not part of a window view hierarchy
View.mAttachInfo is null (view detached)
View.mWindowAttachCount = 1
mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false
Anyway if I dump memory from android studio there are no instances of NestedScrollWebView class in memory...
from leakcanary.
The following leak is happening on google pixel A4 and Android 13
┬─── │ GC Root: Global variable in native code │ ├─ WV.H5 instance │ Leaking: UNKNOWN │ Retaining 61,3 kB in 1123 objects │ ↓ H5.c │ ~ ├─ org.chromium.android_webview.AwContents instance │ Leaking: UNKNOWN │ Retaining 61,3 kB in 1122 objects │ e instance of WV.Rc, wrapping activity it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false │ ↓ AwContents.c │ ~ ├─ it.jannax.base.view.NestedScrollWebView instance │ Leaking: UNKNOWN │ Retaining 56,5 kB in 998 objects │ View not part of a window view hierarchy │ View.mAttachInfo is null (view detached) │ View.mID = R.id.webView │ View.mWindowAttachCount = 1 │ mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false │ ↓ View.mParent │ ~~~~~~~ ├─ android.widget.RelativeLayout instance │ Leaking: UNKNOWN │ Retaining 52,2 kB in 943 objects │ View not part of a window view hierarchy │ View.mAttachInfo is null (view detached) │ View.mID = R.id.container │ View.mWindowAttachCount = 1 │ mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false │ ↓ View.mParent │ ~~~~~~~ ├─ android.widget.FrameLayout instance │ Leaking: UNKNOWN │ Retaining 11,4 kB in 163 objects │ View not part of a window view hierarchy │ View.mAttachInfo is null (view detached) │ View.mID = R.id.content │ View.mWindowAttachCount = 1 │ mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false │ ↓ View.mParent │ ~~~~~~~ ╰→ android.widget.LinearLayout instance Leaking: YES (ObjectWatcher was watching this because it.jannax.game.solitaire.fragment.CardFragment received Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks)) Retaining 10,1 kB in 148 objects key = 82f3abce-e1be-4a3c-9dad-0d337d8adab1 watchDurationMillis = 5625 retainedDurationMillis = 624 View not part of a window view hierarchy View.mAttachInfo is null (view detached) View.mWindowAttachCount = 1 mContext instance of it.jannax.game.solitaire.activity.MainActivity with mDestroyed = false
Anyway if I dump memory from android studio there are no instances of NestedScrollWebView class in memory...
same to you
from leakcanary.
On Redmi K50, MIUI14 (Android 13)
┬───
│ GC Root: Global variable in native code
│
├─ WV.a6 instance
│ Leaking: UNKNOWN
│ Retaining 251.2 kB in 2821 objects
│ ↓ a6.c
│ ~
├─ org.chromium.android_webview.AwContents instance
│ Leaking: UNKNOWN
│ Retaining 251.1 kB in 2820 objects
│ e instance of WV.gd, wrapping activity com.w2fzu.fzuhelper.main.module.
│ common.FragmentContainerActivity with mDestroyed = true
│ ↓ AwContents.c
│ ~
├─ com.w2fzu.fzuhelper.view.MyWebView instance
│ Leaking: YES (View.mContext references a destroyed activity)
│ Retaining 18.1 kB in 395 objects
│ View not part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.webView
│ View.mWindowAttachCount = 1
│ mContext instance of com.w2fzu.fzuhelper.main.module.common.
│ FragmentContainerActivity with mDestroyed = true
│ ↓ View.mParent
├─ android.widget.FrameLayout instance
│ Leaking: YES (MyWebView↑ is leaking and View.mContext references a
│ destroyed activity)
│ Retaining 1.2 kB in 15 objects
│ View not part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mWindowAttachCount = 1
│ mContext instance of com.w2fzu.fzuhelper.main.module.common.
│ FragmentContainerActivity with mDestroyed = true
│ ↓ View.mParent
╰→ android.widget.LinearLayout instance
Leaking: YES (ObjectWatcher was watching this because com.w2fzu.fzuhelper.
ui.BrowserFragment received Fragment#onDestroyView() callback (references
to its views should be cleared to prevent leaks) and View.mContext
references a destroyed activity)
Retaining 2.7 kB in 65 objects
key = dd097d9d-e1e8-4824-aa7a-2274c7a1650d
watchDurationMillis = 5702
retainedDurationMillis = 702
View not part of a window view hierarchy
View.mAttachInfo is null (view detached)
View.mWindowAttachCount = 1
mContext instance of com.w2fzu.fzuhelper.main.module.common.
FragmentContainerActivity with mDestroyed = true
Same. I've tried this, but had no effect.
from leakcanary.
Same leak reported in Android 14, Pixel 6a
from leakcanary.
Working on a repro https://github.com/pyricau/chromium-webview-leak
from leakcanary.
we should also update to include :
AndroidReferenceMatchers.instanceFieldLeak(
"WV.R9",
"e",
"https://github.com/square/leakcanary/issues/2575"
) +
AndroidReferenceMatchers.instanceFieldLeak(
"WV.a6",
"c",
"https://github.com/square/leakcanary/issues/2575"
) +
AndroidReferenceMatchers.instanceFieldLeak(
"WV.H5",
"c",
"https://github.com/square/leakcanary/issues/2575"
) +
AndroidReferenceMatchers.instanceFieldLeak(
"WV.Y9",
"e",
"https://github.com/square/leakcanary/issues/2575"
) +
from leakcanary.
Related Issues (20)
- Documentation - Link to AndroidReferenceMatchers path in github is outdated
- This is a strange question HOT 1
- v2.12 tag accidentally on wrong branch? HOT 1
- leakcary of this HOT 4
- Memory leak detected in ViewDataBinding.sReferenceQueue HOT 3
- targetSdkVersion 34 cause missingForegroundServiceTypeException HOT 1
- InputMethodManager.mImeInsetsConsumer leaking in API 30
- ANR in com.xxx.xxx:leakcanary HOT 1
- Memory leak in HeapAnalyzerService HOT 1
- AndroidObjectInspectors should read FragmentManagerImpl.mDestroyed to surface FragmentManagerImpl reachability
- Add imports to examples in docs HOT 3
- Fix backward compatibility in LeakCanary 3.0 alpha 1
- Getting ANR in ServiceWatcher in release builds with object-watcher-android artefact HOT 3
- bug
- UI for manual heap growth detection
- Heap analysis failed-Failed resolution of: Lokio/Okio HOT 1
- seguimiento de pila
- analysis via backgroundThreadHeapAnalyzer end at 90% HOT 1
- Use @RestrictTo
- Type: bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leakcanary.