Code Monkey home page Code Monkey logo

Comments (7)

pyricau avatar pyricau commented on May 24, 2024 4

Reproduced the leak and root caused it: https://bugs.chromium.org/p/chromium/issues/detail?id=1499154

from leakcanary.

cupral avatar cupral commented on May 24, 2024

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.

asan855 avatar asan855 commented on May 24, 2024

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.

klxiaoniu avatar klxiaoniu commented on May 24, 2024

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.

aloz77 avatar aloz77 commented on May 24, 2024

Same leak reported in Android 14, Pixel 6a

from leakcanary.

pyricau avatar pyricau commented on May 24, 2024

Working on a repro https://github.com/pyricau/chromium-webview-leak

from leakcanary.

joshskeen avatar joshskeen commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.