smallseo.info

leakcanary

A memory leak detection library for Android and Java.

NullPointerException from LeakCanary when running Robolectric tests

Added LeakCanary (1.3) to my Application:

@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    LeakCanary.install(this);

When I run the Robolectric test suite for my application I get a NullPointerException in LeakCanary.

Caused by: java.lang.NullPointerException
at com.squareup.leakcanary.LeakCanary.isInServiceProcess(LeakCanary.java:165)
at com.squareup.leakcanary.LeakCanary.isInAnalyzerProcess(LeakCanary.java:141)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:52)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:43)
at com.package.application.MyApplication.onCreate(MyApplication.java:50)
at org.robolectric.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:131)
at org.robolectric.RobolectricTestRunner.setUpApplicationState(RobolectricTestRunner.java:431)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:224)

I added that Im using Crashlytics to point out that it (and other methods as well) receives the same Application but does not throw any Exceptions.

Wasn't sure if this should be here or on GitHub issues for LeakCanary. Anyone else experiencing this issue?


Source: (StackOverflow)

Why is this a memory leak

I came across a library for memory leak detection in Android (Java) called LeakCanary but cannot understand the example where they leak the memory. Could anybody please explain how and why the code shown in their example is a memory leak.

class Cat {
}
class Box {
  Cat hiddenCat;
}
class Docker {
  static Box container;
}

// ...

Box box = new Box();
Cat schrodingerCat = new Cat();
box.hiddenCat = schrodingerCat;
Docker.container = box;

and then they watch the variable schrodingerCat for leaks which gives a leak shown as follows (which I dont know how to relate to the above code).

* GC ROOT static Docker.container
* references Box.hiddenCat
* leaks Cat instance

Any help with the explanation of the leak and how the detection relates to it would be very helpful. Also some good articles for beginners would be nice.

Thanks!


Source: (StackOverflow)

aapt finished with non-zero exit value 1

Recently I'm trying to use LeakCanary to fix OOM(out of memory) issues for my Android app. And I added

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'

to my build.gradle, following the instructions on LeakCanary website. After gradle build, I got

"/android-sdk/android-sdk_r22.6.2-linux/build-tools/21.1.1/aapt'' finished with non-zero exit value 1 

This is part of my build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.1'
    }
}

apply plugin: 'android'
apply plugin: 'maven'

android {
    compileSdkVersion 19
    buildToolsVersion '22.0.1'

    defaultConfig {
        multiDexEnabled true
    }

    lintOptions {
        abortOnError false
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            assets.srcDirs = ['assets']
            res.srcDirs = ['res']
        }

        instrumentTest.setRoot('tests')
    }

    dexOptions {
        jumboMode = true
        preDexLibraries = false
        javaMaxHeapSize = '2g'
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
    maven {
        url "http://XXXXX/nexus/content/repositories/releases"
    }
}

dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile(name: 'ShortcutBadger-1.0.1', ext: 'aar')
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
}

Source: (StackOverflow)

Cant build Gradle for LeakCanary library

I tried to build Gradle:

Executing command: "--stacktrace"

FAILURE: Build failed with an exception.

  • Where: Build file 'H:\Nin_in_the_winD\working.space\development\branch\eazy\build.gradle' line: 2

  • What went wrong: A problem occurred evaluating root project 'eazy'.

    Could not find method debugCompile() for arguments [com.squareup.leakcanary:leakcanary-android:1.3.1@aar] on root project 'eazy'.

  • Try: Run with --info or --debug option to get more log output.

  • Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'eazy'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:76) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$1.run(DefaultScriptPluginFactory.java:148) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:156) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26) at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:487) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:85) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:129) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:90) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:50) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:27) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:40) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:169) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:33) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) Caused by: org.gradle.api.internal.MissingMethodException: Could not find method debugCompile() for arguments [com.squareup.leakcanary:leakcanary-android:1.3.1@aar] on root project 'eazy'. at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68) at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56) at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:175) at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79) at build_4cypqr1onvufm2h2phqvhowz7$_run_closure1.doCall(H:\Nin_in_the_winD\working.space\development\branch\eazy\build.gradle:2) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91) at org.gradle.api.internal.project.AbstractProject.dependencies(AbstractProject.java:838) at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:232) at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:127) at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:150) at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79) at build_4cypqr1onvufm2h2phqvhowz7.run(H:\Nin_in_the_winD\working.space\development\branch\eazy\build.gradle:1) at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:74) ... 35 more

Here is my gradle.build:

dependencies {
  debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1@aar'
  releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1@aar'
}
repositories {
  mavenCentral()
}

Source: (StackOverflow)

Android Leak Canary Log

I am using Leaky Canary to detect memory leaks in my app. While I was able to get rid of 2-3 issues before this, I cannot figure out where the leak is from this log

11-14 18:05:05.330 32099-3554/? D/LeakCanary: In com.prism.prism:1.1:2.
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * com.prism.prism.RatePicActivity_ has leaked:
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * GC ROOT android.database.ContentObserver$Transport.mContentObserver
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * references android.app.Activity$SettingsObserver.this$0
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * leaks com.prism.prism.RatePicActivity_ instance
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Reference Key: 29bcc62a-b7e2-4d80-8cda-be2f841f19aa
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Device: samsung samsung GT-I9300 m0xx
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Android Version: 4.4.4 API: 19 LeakCanary: 1.3.1
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Durations: watch=5024ms, gc=176ms, heap dump=1129ms, analysis=12787ms
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Details:
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Instance of android.database.ContentObserver$Transport
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mContentObserver = android.app.Activity$SettingsObserver [id=0x41b22d00]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mDescriptor = java.lang.String [id=0x41913c70]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mOwner = android.database.ContentObserver$Transport [id=0x41b1a878]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mObject = 1570915608
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Instance of android.app.Activity$SettingsObserver
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   this$0 = com.prism.prism.RatePicActivity_ [id=0x41ba5aa0]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mHandler = android.os.Handler [id=0x41c45f78]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mLock = java.lang.Object [id=0x41c7c220]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mTransport = android.database.ContentObserver$Transport [id=0x41b1a878]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: * Instance of com.prism.prism.RatePicActivity_
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   onViewChangedNotifier_ = org.androidannotations.api.view.OnViewChangedNotifier [id=0x41cceb68]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   application = com.prism.prism.MyApplication_ [id=0x41b26fe0]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   backgroundImageView = android.support.v7.widget.AppCompatImageView [id=0x41ba1960]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   fragment_container = android.widget.FrameLayout [id=0x41b6f098]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mDelegate = android.support.v7.app.AppCompatDelegateImplV14 [id=0x4226a548]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mMediaController = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mFragments = android.support.v4.app.FragmentController [id=0x41cd05c0]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mHandler =     android.support.v4.app.FragmentActivity$1 [id=0x41c63520]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mCreated = true
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mOptionsMenuInvalidated = false
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mReallyStopped = true
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mRequestedPermissionsFromFragment = false
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mResumed = false
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mRetaining = false
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mStopped = true
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mActionBar = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mActivityInfo = android.content.pm.ActivityInfo [id=0x41c6ab08]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mAllLoaderManagers = android.util.ArrayMap [id=0x41cab818]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mApplication = com.prism.prism.MyApplication_ [id=0x41b26fe0]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mWindowManager = android.view.WindowManagerImpl [id=0x41c48e60]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mWindow = com.android.internal.policy.impl.PhoneWindow [id=0x41b966a0]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mUiThread = java.lang.Thread [id=0x417e1d80]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mTranslucentCallback = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mComponent = android.content.ComponentName [id=0x41c76c08]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mToken = android.os.BinderProxy [id=0x41c730f8]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mContainer = android.app.Activity$1 [id=0x41cffe98]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mCurrentConfig = android.content.res.Configuration [id=0x41df0360]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mDecor = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mTitle = java.lang.String [id=0x41b66db8]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mDefaultKeySsb = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mSettingsObserver = android.app.Activity$SettingsObserver [id=0x41b22d00]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mSearchManager = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mEmbeddedID = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mResultData = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mParent = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mFragments = android.app.FragmentManagerImpl [id=0x41ed3590]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mHandler = android.os.Handler [id=0x41c45f78]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mMenuInflater = null
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mImmerseModeRunnable = android.app.Activity$3 [id=0x41cebb80]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mInstanceTracker = android.os.StrictMode$InstanceTracker [id=0x41cf0dc0]
11-14 18:05:05.330 32099-3554/? D/LeakCanary: |   mInstrumentation = android.app.Instrumentation [id=0x41b26818]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mIntent = android.content.Intent [id=0x41b19e40]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mLastNonConfigurationInstances = null
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mLoaderManager = null
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mManagedDialogs = null
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mMainThread = android.app.ActivityThread [id=0x41b16958]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mManagedCursors = java.util.ArrayList [id=0x41c6d948]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mLoadersStarted = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mIdent = 1103360840
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mFinished = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mResultCode = 0
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mEnableDefaultActionBarUp = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mResumed = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mDoReportFullyDrawn = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mDestroyed = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mStartedActivity = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mStopped = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mTemporaryPause = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mDefaultKeyMode = 0
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mTitleColor = 0
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mTitleReady = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mConfigChangeFlags = 0
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mCheckedForLoaderManager = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mChangingConfigurations = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mVisibleFromClient = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mVisibleFromServer = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mChangeCanvasToTranslucent = false
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mWindowAdded = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mCalled = true
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mBase = uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper [id=0x41c522b8]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mInflater = uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater [id=0x41df9618]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mOverrideConfiguration = null
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mResources = android.content.res.XResources [id=0x41b22d80]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mTheme = android.content.res.Resources$Theme [id=0x41c48c10]
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mThemeResource = 2131492994
11-14 18:05:05.335 32099-3554/? D/LeakCanary: |   mBase = uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper [id=0x41c522b8]
11-14 18:05:05.335 32099-3554/? E/LeakCanary: Leak result dropped because we already store 7 leak traces.

I am unable to tell where the memory leak is occurring in this case. Can someone point out how to go about identifying it?


Source: (StackOverflow)

Reading LeakCanary Log

I have installed LeakCanary to see if my app had memory leaks.

It appears so, but I can't read the log, any one can tell me how, or give the good tutorial I can't find???

In the doc in github, it says:

Once you have the leak trace, figure out which reference in the path should not exist. Then figure out why that reference still exists.

But I don't know how to do it.

Tx!

Here is my log.

In com.myapp.mobile:1.3:33.
* LEAK CAN BE IGNORED.
* com.myapp.mobile.SplashScreen has leaked:
* GC ROOT static android.view.ViewConfiguration.
* references android.util.SparseArray.mValues
* references array java.lang.Object[].[0]
* references android.view.ViewConfiguration.mContext
* leaks com.myapp.mobile.SplashScreen instance
[ 07-17 14:59:07.213 32231:  770 D/LeakCanary ]

* Device: samsung samsung SGH-I337M jflteub
* Android Version: 4.4.2 API: 19 LeakCanary: 1.3.1
* Durations: watch=5014ms, gc=155ms, heap dump=1322ms, 
[ 07-17 14:59:07.213 32231:  770 D/LeakCanary ]

* Class android.view.ViewConfiguration
|   static $staticOverhead = byte[] [
|   static DEFAULT_LONG_PRESS_TIMEOUT = 500
|   static DOUBLE_TAP_MIN_TIME = 40
|   static DOUBLE_TAP_SLOP = 100
|   static DOUBLE_TAP_TIMEOUT = 300
|   static DOUBLE_TAP_TOUCH_SLOP = 8
|   static EDGE_SLOP = 12
|   static FADING_EDGE_LENGTH = 12
|   static GLOBAL_ACTIONS_KEY_TIMEOUT = 500
|   static HOVER_TAP_SLOP = 20
|   static HOVER_TAP_TIMEOUT = 150
|   static JUMP_TAP_TIMEOUT = 500
|   static KEY_REPEAT_DELAY = 50
|   static MAXIMUM_DRAWING_CACHE_SIZE = 1536000
|   static MAXIMUM_FLING_VELOCITY = 8000
|   static MINIMUM_FLING_VELOCITY = 50
|   static OVERFLING_DISTANCE = 6
|   static OVERSCROLL_DISTANCE = 0
|   static PAGING_TOUCH_SLOP = 16
|   static PRESSED_STATE_DURATION = 64
|   static SCROLL_BAR_DEFAULT_DELAY = 300
|   static SCROLL_BAR_FADE_DURATION = 250
|   static SCROLL_BAR_SIZE = 10
|   static SCROLL_FRICTION = 0.015
|   static 
|   static TAP_TIMEOUT = 180
|   static TOUCH_SLOP = 8
|   static WINDOW_TOUCH_SLOP = 16
|   static ZOOM_CONTROLS_TIMEOUT = 3000
|   static sConfigurations = android.util.SparseArray [
* Instance of android.util.SparseArray
|   static $staticOverhead = byte[] [
|   static DELETED = java.lang.Object [id=0x41884b48]
|   mValues = java.lang.Object[] [id=0x421af900;length=5
|   mKeys = int[] [id=0x421af8d8;length=5;size=32]
|   mSize = 1
|   mGarbage = false
* Array of java.lang.Object[]
|   [0] = android.view.ViewConfiguration [id=0x42a8a2d8]
|   [1] = null
|   [2] = null
|   [3] = null
|   [4] = null
* Instance of android.view.ViewConfiguration
|   static $staticOverhead = byte[] [
|   static DEFAULT_LONG_PRESS_TIMEOUT = 500
|   static DOUBLE_TAP_MIN_TIME = 40
|   static DOUBLE_TAP_SLOP = 100
|   static DOUBLE_TAP_TIMEOUT = 300
|   static DOUBLE_TAP_TOUCH_SLOP = 8
|   static EDGE_SLOP = 12
|   static FADING_EDGE_LENGTH = 12
|   static GLOBAL_ACTIONS_KEY_TIMEOUT = 500
|   static HOVER_TAP_SLOP = 20
|   static HOVER_TAP_TIMEOUT = 150
|   static JUMP_TAP_TIMEOUT = 500
|   static KEY_REPEAT_DELAY = 50
|   static MAXIMUM_DRAWING_CACHE_SIZE = 1536000
|   static MAXIMUM_FLING_VELOCITY = 8000
|   static MINIMUM_FLING_VELOCITY = 50
|   static OVERFLING_DISTANCE = 6
|   static OVERSCROLL_DISTANCE = 0
|   static PAGING_TOUCH_SLOP = 16
|   static PRESSED_STATE_DURATION = 64
|   static SCROLL_BAR_DEFAULT_DELAY = 300
|   static SCROLL_BAR_FADE_DURATION = 250
|   static SCROLL_BAR_SIZE = 10
|   static SCROLL_FRICTION = 0.015
|   static 
|   static TAP_TIMEOUT = 180
|   static TOUCH_SLOP = 8
|   static WINDOW_TOUCH_SLOP = 16
|   static ZOOM_CONTROLS_TIMEOUT = 3000
|   static sConfigurations = android.util.SparseArray [
|   mContext = com.myapp.mobile.SplashScreen [
|   mDoubleTapSlop = 300
|   mDoubleTapTouchSlop = 48
|   mEdgeSlop = 36
|   mFadingEdgeLength = 36
|   mFadingMarqueeEnabled = false
|   mMaximumDrawingCacheSize = 8294400
|   mMaximumFlingVelocity = 24000
|   mMinimumFlingVelocity = 150
|   mOverflingDistance = 18
|   mOverscrollDistance = 0
|   mPagingTouchSlop = 96
|   mScrollbarSize = 30
|   mTouchSlop = 48
|   mWindowTouchSlop = 48
|   sHasPermanentMenuKey = true
|   sHasPermanentMenuKeySet = true
* Instance of com.myapp.mobile.SplashScreen
|   ctx = com.myapp.mobile.SplashScreen [id=0x42a7c450]
|   prefs = android.app.SharedPreferencesImpl [
|   mActionBar = null
|   mActivityInfo = android.content.pm.ActivityInfo [
|   mAllLoaderManagers = android.util.ArrayMap [
|   mApplication = com.myapp.mobile.MyApplication [
|   mWindowManager = android.view.WindowManagerImpl [
|   mWindow = com.android.internal.policy.impl.
|   mUiThread = java.lang.Thread [id=0x4180aea0]
|   mTranslucentCallback = null
|   mComponent = android.content.ComponentName [
|   mToken = android.os.BinderProxy [id=0x42a03820]
|   mContainer = android.app.Activity$1 [id=0x42a7c5c8]
|   mCurrentConfig = android.content.res.Configuration [
|   mDecor = null
|   mTitle = java.lang.String [id=0x42a85570]
|   mDefaultKeySsb = null
|   mSearchManager = null
|   mResultData = null
|   mEmbeddedID = null
|   mParent = null
|   mMenuInflater = null
|   mFragments = android.app.FragmentManagerImpl [
|   mHandler = android.os.Handler [id=0x42a7c670]
|   mManagedDialogs = null
|   mInstanceTracker = android.os.
|   mInstrumentation = android.app.Instrumentation [
|   mIntent = android.content.Intent [id=0x42a03568]
|   mLastNonConfigurationInstances = null
|   mLoaderManager = null
|   mManagedCursors = java.util.ArrayList [id=0x42a7c5d8
|   mMainThread = android.app.ActivityThread [
|   mLoadersStarted = false
|   mIdent = 1123061480
|   mFinished = true
|   mEnableDefaultActionBarUp = false
|   mResultCode = 0
|   mDoReportFullyDrawn = false
|   mResumed = false
|   mDestroyed = true
|   mStartedActivity = false
|   mStopped = true
|   mTemporaryPause = false
|   mDefaultKeyMode = 0
|   mTitleColor = 0
|   mTitleReady = true
|   mConfigChangeFlags = 0
|   mCheckedForLoaderManager = true
|   mChangingConfigurations = false
|   mVisibleFromClient = true
|   mVisibleFromServer = false
|   mChangeCanvasToTranslucent = false
|   mWindowAdded = true
|   mCalled = true
|   mBase = android.app.ContextImpl [id=0x42a7c690]
|   mInflater = com.android.internal.policy.impl.
|   mOverrideConfiguration = null
|   mResources = android.content.res.Resources [
|   mTheme = android.content.res.Resources$Theme [
|   mThemeResource = 2131296377
|   mBase = android.app.ContextImpl [id=0x42a7c690]

In com.myapp.mobile:1.3:33.
* com.myapp.mobile.MetricaTabs has leaked:
* GC ROOT static com.myapp.mobile.MetricaTabs.ctx
* leaks com.myapp.mobile.MetricaTabs instance
[ 07-17 15:00:10.945 32231: 1926 D/LeakCanary ]

* Device: samsung samsung SGH-I337M jflteub
* Android Version: 4.4.2 API: 19 LeakCanary: 1.3.1
* Durations: watch=5015ms, gc=218ms, heap dump=1071ms, 
[ 07-17 15:00:10.945 32231: 1926 D/LeakCanary ]

* Class com.myapp.mobile.MetricaTabs
|   static $staticOverhead = byte[] [
|   static ENCUESTA = 5
|   static METRICA_DATOS = 0
|   static METRICA_ENCUESTAS = 1
|   static TEN_SECONDS = 10000
|   static ctx = com.myapp.mobile.MetricaTabs [
|   static errorList = java.util.ArrayList [
|   static idCaptura = 4
|   static idEncuesta = 0
|   static imageFileUri = null
|   static lMetricas = java.util.ArrayList [
|   static listLV = null
|   static rclForm = android.support.v7.widget.
|   static transparentEt = android.support.v7.widget.
* Instance of com.myapp.mobile.MetricaTabs
|   static $staticOverhead = byte[] [
|   static ENCUESTA = 5
|   static METRICA_DATOS = 0
|   static METRICA_ENCUESTAS = 1
|   static TEN_SECONDS = 10000
|   static ctx = com.myapp.mobile.MetricaTabs [
|   static errorList = java.util.ArrayList [
|   static idCaptura = 4
|   static idEncuesta = 0
|   static imageFileUri = null
|   static lMetricas = java.util.ArrayList [
|   static listLV = null
|   static rclForm = android.support.v7.widget.
|   static transparentEt = android.support.v7.widget.
|   ab = android.support.v7.internal.app.
|   adbForm = null
|   eh = com.myapp.mobile.sqlite.EncuestaHandler [
|   tabLayout = android.support.design.widget.TabLayout 
|   loc = null
|   mCaptura = null
|   mEncuesta = null
|   mSectionsPagerAdapter = com.myapp.mobile.
|   mViewPager = android.support.v4.view.ViewPager [
|   metrica = null
|   prefs = android.app.SharedPreferencesImpl [
|   numTab = 0
|   saveAndNew = false
|   encuesta = 0
|   mDelegate = android.support.v7.app.
|   mAllLoaderManagers = android.support.v4.util.
|   mLoaderManager = null
|   mContainer = android.support.v4.app.
|   mHandler = android.support.v4.app.
|   mFragments = android.support.v4.app.
|   mCreated = true
|   mCheckedForLoaderManager = true
|   mLoadersStarted = false
|   mOptionsMenuInvalidated = false
|   mReallyStopped = true
|   mResumed = false
|   mRetaining = false
|   mStopped = true
|   mActionBar = null
|   mActivityInfo = android.content.pm.ActivityInfo [
|   mAllLoaderManagers = android.util.ArrayMap [
|   mApplication = com.myapp.mobile.MyApplication [
|   mWindowManager = android.view.WindowManagerImpl [
|   mWindow = com.android.internal.policy.impl.
|   mUiThread = java.lang.Thread [id=0x4180aea0]
|   mTranslucentCallback = null
|   mComponent = android.content.ComponentName [
|   mToken = android.os.BinderProxy [id=0x42f18c40]
|   mContainer = android.app.Activity$1 [id=0x42a92978]
|   mCurrentConfig = android.content.res.Configuration [
|   mDecor = null
|   mTitle = java.lang.String [id=0x42fb8850]
|   mDefaultKeySsb = null
|   mSearchManager = null
|   mResultData = null
|   mEmbeddedID = null
|   mParent = null
|   mMenuInflater = null
|   mFragments = android.app.FragmentManagerImpl [
|   mHandler = android.os.Handler [id=0x429fd658]
|   mManagedDialogs = null
|   mInstanceTracker = android.os.
|   mInstrumentation = android.app.Instrumentation [
|   mIntent = android.content.Intent [id=0x42f2ded8]
|   mLastNonConfigurationInstances = null
|   mLoaderManager = null
|   mManagedCursors = java.util.ArrayList [id=0x42a145a8
|   mMainThread = android.app.ActivityThread [
|   mLoadersStarted = false
|   mIdent = 1136727720
|   mFinished = true
|   mEnableDefaultActionBarUp = false
|   mResultCode = 0
|   mDoReportFullyDrawn = false
|   mResumed = false
|   mDestroyed = true
|   mStartedActivity = false
|   mStopped = true
|   mTemporaryPause = false
|   mDefaultKeyMode = 0
|   mTitleColor = 0
|   mTitleReady = true
|   mConfigChangeFlags = 0
|   mCheckedForLoaderManager = true
|   mChangingConfigurations = false
|   mVisibleFromClient = true
|   mVisibleFromServer = true
|   mChangeCanvasToTranslucent = false
|   mWindowAdded = true
|   mCalled = true
|   mBase = android.app.ContextImpl [id=0x429f95b0]
|   mInflater = com.android.internal.policy.impl.
|   mOverrideConfiguration = null
|   mResources = android.content.res.Resources [
|   mTheme = android.content.res.Resources$Theme [
|   mThemeResource = 2131296377
|   mBase = android.app.ContextImpl [id=0x429f95b0]

Source: (StackOverflow)

LeakCanary's DisplayLeakActivity has leaked, any insights?

I recently added the LeakCanary library to my application. After detecting a couple activity leaks and viewing them, I saw that LeakCanary's DisplayLeakActivity had leaked. I can't find anything in the reference path that is part of my application, and as far as I can tell, I have followed the instructions for proper usage (they're pretty straightforward :) ).

The reference path is as follows:

In com.chris:0.890:890.

  • com.squareup.leakcanary.internal.DisplayLeakActivity has leaked:
  • GC ROOT android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue
  • references android.os.MessageQueue.mMessages
  • references android.os.Message.callback
  • references android.view.View$ScrollabilityCache.host
  • references android.widget.ListView.mContext
  • leaks com.squareup.leakcanary.internal.DisplayLeakActivity instance

  • Reference Key: 48e6a173-9de4-436f-9eef-0913ebabadf6

  • Device: LGE lge LG-LS980 g2_spr_us
  • Android Version: 4.4.2 API: 19
  • Durations: watch=5127ms, gc=246ms, heap dump=3729ms, analysis=18335ms

It should be noted that this has only occured on an LG G2. I have not seen it on any other devices. Has anyone seen this or does anyone know what might be causing it?


Source: (StackOverflow)

How can I include LeakCanary when using both build types and product flavors?

The LeakCanary documentation mentions the following for handling build types:

 dependencies {
   debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
   releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
 }

However, what about when using multiple product flavors as well? I'm receiving an error Gradle DSL method not found on the buildTypeCompile functions.

Here is a skeleton of my current Gradle file:

android {
    ...

    dependencies {
        debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
        ciCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
        qaCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
        uatCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
        prodCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
        releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
    }

    productFlavors {
        foo {
            buildTypes {
                ci {
                    ...
                }

                qa {
                    ...
                }
            }
        }

        bar {
            buildTypes {
                ci {
                    ...
                }

                qa {
                    ...
                }
            }
        }
    }
}

Source: (StackOverflow)

Stuck at "Dumping memory, app will freeze. Brrr." message

I'm trying to use LeakCanary to detect memory leaks in my app, but it does not go further than the message "Dumping memory, app will freeze. Brrr." I've been waiting for about 20 minutes or so, but no changes. Same behaviour on these devices: 1. Asus fonepad 8 (Android 5.0 stock) 2. Sony Xperia SP (Android 5.1.1 CM 12.1 custom) 3. HTC Desire C (Android 4.4 CM 11 custom)

I did everything as its advised in instruction:

public class ExampleApplication extends Application {

  @Override public void onCreate() {
    super.onCreate();
    LeakCanary.install(this);
  }
}

Source: (StackOverflow)

Memory Leak on AppCompatActivity using LeakCanary

I use LeakCanary and unfortunately got a leak and here is the logcat:

05-10 18:13:00.377    9098-9965/com.ponnex.justdrive D/LeakCanary´╣Ľ In com.ponnex.justdrive:1.0:1.
* com.ponnex.justdrive.DebuggingActivity has leaked:
* GC ROOT static android.support.v4.content.LocalBroadcastManager.mInstance
* references android.support.v4.content.LocalBroadcastManager.mReceivers
* references java.util.HashMap.table
* references array java.util.HashMap$HashMapEntry[].[51]
* references java.util.HashMap$HashMapEntry.key
* references com.ponnex.justdrive.DebuggingActivity$3.this$0 (anonymous class extends android.content.BroadcastReceiver)
* leaks com.ponnex.justdrive.DebuggingActivity instance
* Reference Key: 4fea07d9-9369-4618-a8e0-9e63b3e1b908
* Device: samsung samsung GT-I9100 pa_i9100
* Android Version: 5.1.1 API: 22
* Durations: watch=5219ms, gc=244ms, heap dump=4978ms, analysis=19968ms

This is my DebuggingActivity

@Override
protected void onCreate(Bundle savedInstanceState) {
LeakCanary.install(getApplication());
setContentView(R.layout.activity_debugging);
activityTV = (TextView) findViewById(R.id.debugText);
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(screenReceiver, new IntentFilter("com.ponnex.justdrive.ActivityRecognitionIntentService"));

}
private BroadcastReceiver screenReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        String activity = intent.getStringExtra("Activity");
        updateUI(activity);
    }
};

public static void updateUI(String activity) {
    activityTV.setText(activity);
}

I've been checking my activity and tracing it out but I don't know how to fix this any help? :D

If you need more from my activity code I'll be glad to add or post them here ;)

---EDIT---

I also got a leak from another activity refering to snackbar(Snackbar by Nispok)

05-10 18:27:43.161   9098-16222/com.ponnex.justdrive D/LeakCanary´╣Ľ In com.ponnex.justdrive:1.0:1.
* com.ponnex.justdrive.MainActivity has leaked:
* GC ROOT static com.nispok.snackbar.SnackbarManager.currentSnackbar
* references com.nispok.snackbar.Snackbar.mContext
* leaks com.ponnex.justdrive.MainActivity instance
* Reference Key: 1982a1a8-e66e-4218-9b5a-8f907ee26a7f
* Device: samsung samsung GT-I9100 pa_i9100
* Android Version: 5.1.1 API: 22
* Durations: watch=5291ms, gc=315ms, heap dump=4443ms, analysis=21801ms

Source: (StackOverflow)

LeakCanary - Activity is leaked as it implements SyncStatusObserver

I am using LeakCanary to identify memory leaks. I have an Activity which adds itself as the StatusChangeObserver in onResume as below:

    final int mask = ContentResolver.SYNC_OBSERVER_TYPE_PENDING |
            ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE;

    mSyncObserverHandle = ContentResolver.addStatusChangeListener(mask, this);

And stops listening onPause

    ContentResolver.removeStatusChangeListener(mSyncObserverHandle);

When I exit the Activity, LeakCanary reports my Activity is leaked. Below is gist of the leak trace:

     * com.sample.android.MyListActivity has leaked:
     * GC ROOT android.content.ContentResolver$1.val$callback(anonymous class extends android.content.ISyncStatusObserver$Stub)
     * leaks com.sample.android.MyListActivity instance
     [ 06-11 15:35:23.123 11823:13392 D/LeakCanary ]
     * Reference Key: 1eaf447d-055c-4767-bb3f-56b12c7a4dae
     * Device: motorola motorola XT1022 condor_retaildsds
     * Android Version: 4.4.4 API: 19 LeakCanary: 1.3.1
     * Durations: watch=5029ms, gc=147ms, heap dump=693ms, analysis=15159ms
     [ 06-11 15:35:23.123 11823:13392 D/LeakCanary ]

I have tested on API 19 and 22. I would like to know if its a problem with my code or leakcanary or sdk.

Thanks in advance!


Source: (StackOverflow)

RxJava Observable Zip Causes Memory Leak

I am using RxJava's Observable.zip method to combine two API calls into one result. For some reason I am getting a memory leak despite the fact that I unsubscribe from the subscription. I am not sure if this a bug on my end or if there is something I need to do with the creation of the Observable.

protected void onCreate(Bundle bundle) {
...

subscription = Observable.zip(
      api.getConfiguration(),
      api.getSettings().map(r -> r.getData()),
      new Func2<ConfigurationResponse, List<Datum>, Struct>() {
        @Override
        public Struct call(ConfigurationResponse config, List<Datum> data) {
          return new Struct(data, config.getCopy(), config.getSettings());
        }
      }
    )
      .compose(Schedulers.applyApiSchedulers())
      .subscribe(
        struct -> {
          configurationManager.set(struct.data, struct.copy, struct.settings);
          startNextActivity();
        },
        error -> {
          startNextActivity();
        }
      );
}

protected void onDestroy() {
  if (!subscription.isUnsubscribed()) {
    subscription.unsubscribe();
  }
}

Here is the trace from Leak Canary.

leak trace

Any help would be appreciated.


Source: (StackOverflow)

Android Media player keeps app instance and cause a memory leak

I have an activity with a media player as a member variable.

My media player is initialized like this:

mMediaPlayer = new MediaPlayer(); 
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.setDataSource(MyActivity.this, URL); 
mMediaPlayer.prepareAsync(); 
//i set a on Prepared Listener to start playing on Prepared

Everything works just fine, and then i override my activity onStop method to release the Media Player.

if(mMediaPlayer!=null){
   if(mMediaPlayer.isPlaying()){
       mMediaPlayer.stop();
   }
   mMediaPlayer.release();
   mMediaPlayer=null;
}

But after the activity has stopped i get a memory leak report from LeakCanary.

The report is like this:

MyApp.Instance->

MyApp.mLoadedApk->

LoadedApk.mReceivers->

ArrayMap.mArray->

arrayObject[].[3]->

ArrayMap.mArray->

arrayObject[][0]->

MediaPlayer.mProxyReceiver->

MediaPlayer.mProxyContext->

leaks MyActivity instance.

MyApp.Instance->

MyApp.mLoadedApk->

LoadedApk.mReceivers->

ArrayMap.mArray->

arrayObject[].[3]->

ArrayMap.mArray->

arrayObject[][0]->

MediaPlayer.mProxyReceiver->

MediaPlayer.mProxyContext->

leaks MyActivity instance.

Yes i have a MyApp class which extends Application and i am holding a reference to MyApp instance in a static field, but i never use that reference in my activity, how can i solve this leak ?

[EDIT]

Here is the code of my Activity:

public class PlayActivity extends ActionBarActivity {

private MediaPlayer mediaPlayer;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_play);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

@Override
protected void onStop() {
    super.onStop();
    if(mediaPlayer!=null){
        if(mediaPlayer.isPlaying()){
            mediaPlayer.stop();
        }
        mediaPlayer.release();
        mediaPlayer=null;
    }
}

public void playIt(View view){
    if(mediaPlayer==null){
        mediaPlayer = new MediaPlayer();
        mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mp) {
                mp.start();
            }
        });


    }
    if(!mediaPlayer.isPlaying()){
        mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
        try {
            mediaPlayer.setDataSource(PlayActivity.this, Uri.parse("http://www.noiseaddicts.com/samples_1w72b820/142.mp3"));
            mediaPlayer.prepareAsync();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }



   }

 }

Source: (StackOverflow)

Cannot find symbol class AndroidExcludedRefs, DisplayLeakService,

We are declaring our leak-canary dependencies as stated on the project's Github page.

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'

So far, things are working fine. Now we started to exclude a known leak like that:

ExcludedRefs.Builder excludedRefsBuilder = AndroidExcludedRefs.createAppDefaults();
excludedRefsBuilder.staticField("com.google.android.chimera.container.a", "a");
refWatcher = LeakCanary.install(app, DisplayLeakService.class, excludedRefsBuilder.build());

Now when we switch to the release build type, classes like AndroidExcludedRefs, DisplayLeakService and ExcludedRefs are not found anymore, as the "no-op" dependency doesn't include them.

What's the best way to handle this?


Source: (StackOverflow)

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


Source: (StackOverflow)