Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Chrome Facebook webview memory leak using Leakcanary

Randomly I'm having this leaks after performing login with Facebook Webview

enter image description here enter image description here enter image description here

I've found this (the only mention to com.android.org.chromium):

AW_RESOURCE__SRESOURCES(SAMSUNG.equals(MANUFACTURER) && SDK_INT == KITKAT) {
    @Override void add(ExcludedRefs.Builder excluded) {
      // AwResource#setResources() is called with resources that hold a reference to the
      // activity context (instead of the application context) and doesn't clear it.
      // Not sure what's going on there, input welcome.
      excluded.staticField("com.android.org.chromium.android_webview.AwResource", "sResources");
    }
  },

Inside this class AndroidExcludedRefs.java

This class is a work in progress. You can help by reporting leak traces that seem to be caused by the Android SDK, here: https://github.com/square/leakcanary/issues/new

But I'm not using Samsung so I'm still having this leak.
Said that, is this leak a known issue? Can it be ignored?

UPDATE: I was using Facebook SDK v3.19, I've updated to 4.3 but the problem remains: enter image description here

like image 975
GuilhE Avatar asked Dec 15 '25 02:12

GuilhE


2 Answers

There were a couple of memory leak fixes in the latest versions of the Facebook SDK. Make sure you download the latest (v4.3 as of now).

like image 143
Ming Li Avatar answered Dec 16 '25 19:12

Ming Li


So I've been in contact with facebook support center and the conclusion we've reached was:

Your intuition was correct. This seems to be a bug in chrome and not our SDK. It should be fixed in later versions of android since it was fixed in April of this year.

See: https://code.google.com/p/chromium/issues/detail?id=478719

like image 39
GuilhE Avatar answered Dec 16 '25 20:12

GuilhE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!