LeakCanary appears to detect a leak, even though the class is excluded

2.3k views Asked by At

I'm slightly confused by the behavior of LeakCanary, and I'm hoping SO can help me out here. I've added LeakCanary to my app, and I'm seeing a pop-up claiming a leak.

This sure looks like the InputMethodManager mentioned here: https://github.com/square/leakcanary/issues/322

It looks like LeakCanary marks it as excluded, but still shows the popup. Is there something I'm not understanding here? (I can include my exclude code if that helps, but...)

Here's a screenshot of the Leak activity:

leak canary screenshot

Here's the trimmed logcat output:

12-13 15:08:26.868 D/LeakCanary( 1642): In com.blueapron.blueapron.debug:0.0.0-123-g5c653b9-debug:135000.
12-13 15:08:26.868 D/LeakCanary( 1642): * EXCLUDED LEAK.
12-13 15:08:26.868 D/LeakCanary( 1642): * com.blueapron.mobile.ui.MainActivity has leaked:
12-13 15:08:26.868 D/LeakCanary( 1642): * GC ROOT android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper.mParentInputMethodManager , matching exclusion any subclass of android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper
12-13 15:08:26.869 D/LeakCanary( 1642): * references android.view.inputmethod.InputMethodManager.mNextServedView , matching exclusion field android.view.inputmethod.InputMethodManager#mNextServedView
12-13 15:08:26.869 D/LeakCanary( 1642): * references android.support.v7.widget.RecyclerView.mContext
12-13 15:08:26.869 D/LeakCanary( 1642): * leaks com.blueapron.mobile.ui.MainActivity instance
12-13 15:08:26.869 D/LeakCanary( 1642): * Retaining: 6.0 KB.
12-13 15:08:26.869 D/LeakCanary( 1642): * Reference Key: ecc9f4d2-78a2-4542-ae1e-abb4d4e358e4
12-13 15:08:26.869 D/LeakCanary( 1642): * Device: motorola google Nexus 6 shamu
12-13 15:08:26.869 D/LeakCanary( 1642): * Android Version: 6.0.1 API: 23 LeakCanary: 1.5 00f37f5
12-13 15:08:26.869 D/LeakCanary( 1642): * Durations: watch=5157ms, gc=176ms, heap dump=8016ms, analysis=63575ms
12-13 15:08:26.869 D/LeakCanary( 1642): * Details:
12-13 15:08:26.869 D/LeakCanary( 1642): * Instance of android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper
12-13 15:08:26.869 D/LeakCanary( 1642): |   mActive = true
12-13 15:08:26.869 D/LeakCanary( 1642): |   mParentInputMethodManager = android.view.inputmethod.InputMethodManager@316308208 (0x12da7af0)
12-13 15:08:26.869 D/LeakCanary( 1642): |   mH = com.android.internal.view.IInputConnectionWrapper$MyHandler@319129568 (0x130587e0)
12-13 15:08:26.869 D/LeakCanary( 1642): |   mInputConnection = java.lang.ref.WeakReference@319129600 (0x13058800)
12-13 15:08:26.869 D/LeakCanary( 1642): |   mMainLooper = android.os.Looper@314581056 (0x12c02040)
12-13 15:08:26.869 D/LeakCanary( 1642): |   mDescriptor = java.lang.String@1873348736 (0x6fa90880)
12-13 15:08:26.869 D/LeakCanary( 1642): |   mObject = -1361251728
12-13 15:08:26.869 D/LeakCanary( 1642): |   mOwner = android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper@314574736 (0x12c00790)
12-13 15:08:26.869 D/LeakCanary( 1642): |   shadow$_klass_ = android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper
12-13 15:08:26.869 D/LeakCanary( 1642): |   shadow$_monitor_ = 0
12-13 15:08:26.869 D/LeakCanary( 1642): * Instance of android.view.inputmethod.InputMethodManager
12-13 15:08:26.870 D/LeakCanary( 1642): |   static RESULT_UNCHANGED_HIDDEN = 1
12-13 15:08:26.870 D/LeakCanary( 1642): |   static MSG_SET_ACTIVE = 4
12-13 15:08:26.870 D/LeakCanary( 1642): |   static RESULT_HIDDEN = 3
12-13 15:08:26.870 D/LeakCanary( 1642): |   static REQUEST_UPDATE_CURSOR_ANCHOR_INFO_NONE = 0
12-13 15:08:26.870 D/LeakCanary( 1642): |   static sInstance = android.view.inputmethod.InputMethodManager@316308208 (0x12da7af0)
12-13 15:08:26.870 D/LeakCanary( 1642): |   static SHOW_FORCED = 2
12-13 15:08:26.870 D/LeakCanary( 1642): |   static DISPATCH_NOT_HANDLED = 0
12-13 15:08:26.870 D/LeakCanary( 1642): |   static HIDE_NOT_ALWAYS = 2
12-13 15:08:26.870 D/LeakCanary( 1642): |   static NOT_AN_ACTION_NOTIFICATION_SEQUENCE_NUMBER = -1
12-13 15:08:26.870 D/LeakCanary( 1642): |   static MSG_UNBIND = 3
12-13 15:08:26.870 D/LeakCanary( 1642): |   static CONTROL_WINDOW_FIRST = 4
12-13 15:08:26.870 D/LeakCanary( 1642): |   static CONTROL_START_INITIAL = 256
12-13 15:08:26.870 D/LeakCanary( 1642): |   static RESULT_UNCHANGED_SHOWN = 0
12-13 15:08:26.870 D/LeakCanary( 1642): |   static SHOW_IM_PICKER_MODE_AUTO = 0
12-13 15:08:26.870 D/LeakCanary( 1642): |   static SHOW_IMPLICIT = 1
12-13 15:08:26.870 D/LeakCanary( 1642): |   static CONTROL_WINDOW_VIEW_HAS_FOCUS = 1
12-13 15:08:26.870 D/LeakCanary( 1642): |   static MSG_DUMP = 1
12-13 15:08:26.870 D/LeakCanary( 1642): |   static TAG = java.lang.String@1873283504 (0x6fa809b0)
12-13 15:08:26.870 D/LeakCanary( 1642): |   static SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES = 2
12-13 15:08:26.870 D/LeakCanary( 1642): |   static MSG_SEND_INPUT_EVENT = 5
12-13 15:08:26.870 D/LeakCanary( 1642): |   static INPUT_METHOD_NOT_RESPONDING_TIMEOUT = 2500
12-13 15:08:26.870 D/LeakCanary( 1642): |   static DEBUG = false
12-13 15:08:26.870 D/LeakCanary( 1642): |   static PENDING_EVENT_COUNTER = java.lang.String@1873337528 (0x6fa8dcb8)
12-13 15:08:26.870 D/LeakCanary( 1642): |   static RESULT_SHOWN = 2
12-13 15:08:26.871 D/LeakCanary( 1642): |   static DISPATCH_IN_PROGRESS = -1
12-13 15:08:26.871 D/LeakCanary( 1642): |   static MSG_FLUSH_INPUT_EVENT = 7
12-13 15:08:26.871 D/LeakCanary( 1642): |   static $staticOverhead = byte[264]@1876294145 (0x6fd5fa01)
12-13 15:08:26.871 D/LeakCanary( 1642): |   static CONTROL_WINDOW_IS_TEXT_EDITOR = 2
12-13 15:08:26.871 D/LeakCanary( 1642): |   static MSG_TIMEOUT_INPUT_EVENT = 6
12-13 15:08:26.871 D/LeakCanary( 1642): |   static MSG_BIND = 2
12-13 15:08:26.871 D/LeakCanary( 1642): |   static DISPATCH_HANDLED = 1
12-13 15:08:26.871 D/LeakCanary( 1642): |   static SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES = 1
12-13 15:08:26.871 D/LeakCanary( 1642): |   static MSG_SET_USER_ACTION_NOTIFICATION_SEQUENCE_NUMBER = 9
12-13 15:08:26.871 D/LeakCanary( 1642): |   static HIDE_IMPLICIT_ONLY = 1
12-13 15:08:26.871 D/LeakCanary( 1642): |   mActive = false
12-13 15:08:26.871 D/LeakCanary( 1642): |   mBindSequence = -1
12-13 15:08:26.871 D/LeakCanary( 1642): |   mClient = android.view.inputmethod.InputMethodManager$1@314583040 (0x12c02800)
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCompletions = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCurChannel = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCurId = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCurMethod = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCurRootView = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCurSender = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCurrentTextBoxAttribute = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCursorAnchorInfo = null
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCursorCandEnd = 0
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCursorCandStart = 0
12-13 15:08:26.871 D/LeakCanary( 1642): |   mCursorRect = android.graphics.Rect@316910368 (0x12e3ab20)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mCursorSelEnd = 0
12-13 15:08:26.872 D/LeakCanary( 1642): |   mCursorSelStart = 0
12-13 15:08:26.872 D/LeakCanary( 1642): |   mDummyInputConnection = android.view.inputmethod.BaseInputConnection@316910400 (0x12e3ab40)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mFullscreenMode = false
12-13 15:08:26.872 D/LeakCanary( 1642): |   mH = android.view.inputmethod.InputMethodManager$H@316910432 (0x12e3ab60)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mHasBeenInactive = true
12-13 15:08:26.872 D/LeakCanary( 1642): |   mIInputContext = android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper@314574736 (0x12c00790)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mLastSentUserActionNotificationSequenceNumber = -1
12-13 15:08:26.872 D/LeakCanary( 1642): |   mMainLooper = android.os.Looper@314581056 (0x12c02040)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mNextServedView = android.support.v7.widget.RecyclerView@316742656 (0x12e11c00)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mNextUserActionNotificationSequenceNumber = 2
12-13 15:08:26.872 D/LeakCanary( 1642): |   mPendingEventPool = android.util.Pools$SimplePool@314580864 (0x12c01f80)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mPendingEvents = android.util.SparseArray@316910464 (0x12e3ab80)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mRequestUpdateCursorAnchorInfoMonitorMode = 0
12-13 15:08:26.872 D/LeakCanary( 1642): |   mServedConnecting = true
12-13 15:08:26.872 D/LeakCanary( 1642): |   mServedInputConnection = null
12-13 15:08:26.872 D/LeakCanary( 1642): |   mServedInputConnectionWrapper = null
12-13 15:08:26.872 D/LeakCanary( 1642): |   mServedView = android.support.v7.widget.RecyclerView@316742656 (0x12e11c00)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mService = com.android.internal.view.IInputMethodManager$Stub$Proxy@314580880 (0x12c01f90)
12-13 15:08:26.872 D/LeakCanary( 1642): |   mTmpCursorRect = android.graphics.Rect@316910496 (0x12e3aba0)
12-13 15:08:26.872 D/LeakCanary( 1642): |   shadow$_klass_ = android.view.inputmethod.InputMethodManager
12-13 15:08:26.872 D/LeakCanary( 1642): |   shadow$_monitor_ = 0
12-13 15:08:26.872 D/LeakCanary( 1642): * Instance of android.support.v7.widget.RecyclerView
12-13 15:08:26.873 D/LeakCanary( 1642): |   static TRACE_CREATE_VIEW_TAG = java.lang.String@315184464 (0x12c95550)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static TRACE_HANDLE_ADAPTER_UPDATES_TAG = java.lang.String@315097152 (0x12c80040)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static HORIZONTAL = 0
12-13 15:08:26.873 D/LeakCanary( 1642): |   static SCROLL_STATE_IDLE = 0
12-13 15:08:26.873 D/LeakCanary( 1642): |   static MIN_PREFETCH_TIME_NANOS = 4000000
12-13 15:08:26.873 D/LeakCanary( 1642): |   static SCROLL_STATE_DRAGGING = 1
12-13 15:08:26.873 D/LeakCanary( 1642): |   static ALLOW_PREFETCHING = true
12-13 15:08:26.873 D/LeakCanary( 1642): |   static TRACE_BIND_VIEW_TAG = java.lang.String@314983472 (0x12c64430)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static INVALID_TYPE = -1
12-13 15:08:26.873 D/LeakCanary( 1642): |   static TRACE_PREFETCH_TAG = java.lang.String@315109328 (0x12c82fd0)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static TRACE_SCROLL_TAG = java.lang.String@315072864 (0x12c7a160)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static SCROLL_STATE_SETTLING = 2
12-13 15:08:26.873 D/LeakCanary( 1642): |   static NESTED_SCROLLING_ATTRS = int[1]@318192048 (0x12f739b0)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static sQuinticInterpolator = android.support.v7.widget.RecyclerView$3@317774352 (0x12f0da10)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static POST_UPDATES_ON_ANIMATION = true
12-13 15:08:26.873 D/LeakCanary( 1642): |   static TRACE_ON_LAYOUT_TAG = java.lang.String@314774192 (0x12c312b0)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static INVALID_POINTER = -1
12-13 15:08:26.873 D/LeakCanary( 1642): |   static FORCE_INVALIDATE_DISPLAY_LIST = false
12-13 15:08:26.873 D/LeakCanary( 1642): |   static ALLOW_SIZE_IN_UNSPECIFIED_SPEC = true
12-13 15:08:26.873 D/LeakCanary( 1642): |   static TAG = java.lang.String@314957392 (0x12c5de50)
12-13 15:08:26.873 D/LeakCanary( 1642): |   static DEBUG = false
12-13 15:08:26.873 D/LeakCanary( 1642): |   static VERTICAL = 1
12-13 15:08:26.873 D/LeakCanary( 1642): |   static CLIP_TO_PADDING_ATTR = int[1]@318192032 (0x12f739a0)
12-13 15:08:26.874 D/LeakCanary( 1642): |   static TRACE_ON_DATA_SET_CHANGE_LAYOUT_TAG = java.lang.String@315065344 (0x12c78400)
12-13 15:08:26.874 D/LeakCanary( 1642): |   static LAYOUT_MANAGER_CONSTRUCTOR_SIGNATURE = java.lang.Class[4]@318980224 (0x13034080)
12-13 15:08:26.874 D/LeakCanary( 1642): |   static $staticOverhead = byte[256]@316502017 (0x12dd7001)
12-13 15:08:26.874 D/LeakCanary( 1642): |   static TOUCH_SLOP_DEFAULT = 0
12-13 15:08:26.874 D/LeakCanary( 1642): |   static NO_POSITION = -1
12-13 15:08:26.874 D/LeakCanary( 1642): |   static sFrameIntervalNanos = 16666667
12-13 15:08:26.874 D/LeakCanary( 1642): |   static MAX_SCROLL_DURATION = 2000
12-13 15:08:26.874 D/LeakCanary( 1642): |   static TOUCH_SLOP_PAGING = 1
12-13 15:08:26.874 D/LeakCanary( 1642): |   static DISPATCH_TEMP_DETACH = false
12-13 15:08:26.874 D/LeakCanary( 1642): |   static NO_ID = -1
12-13 15:08:26.874 D/LeakCanary( 1642): |   mAccessibilityDelegate = android.support.v7.widget.RecyclerViewAccessibilityDelegate@316910560 (0x12e3abe0)
12-13 15:08:26.874 D/LeakCanary( 1642): |   mAccessibilityManager = android.view.accessibility.AccessibilityManager@316731600 (0x12e0f0d0)
12-13 15:08:26.874 D/LeakCanary( 1642): |   mActiveOnItemTouchListener = null
12-13 15:08:26.874 D/LeakCanary( 1642): |   mAdapter = com.blueapron.mobile.ui.adapters.RecipeOverviewAdapter@316910592 (0x12e3ac00)
12-13 15:08:26.874 D/LeakCanary( 1642): |   mAdapterHelper = android.support.v7.widget.AdapterHelper@316914752 (0x12e3bc40)
12-13 15:08:26.874 D/LeakCanary( 1642): |   mAdapterUpdateDuringMeasure = false
12-13 15:08:26.874 D/LeakCanary( 1642): |   mBottomGlow = null
12-13 15:08:26.874 D/LeakCanary( 1642): |   mChildDrawingOrderCallback = null
12-13 15:08:26.874 D/LeakCanary( 1642): |   mChildHelper = android.support.v7.widget.ChildHelper@316910624 (0x12e3ac20)
12-13 15:08:26.874 D/LeakCanary( 1642): |   mClipToPadding = true
12-13 15:08:26.874 D/LeakCanary( 1642): |   mDataSetHasChangedAfterLayout = false
12-13 15:08:26.874 D/LeakCanary( 1642): |   mDispatchScrollCounter = 0
12-13 15:08:26.875 D/LeakCanary( 1642): |   mEatRequestLayout = 0
12-13 15:08:26.875 D/LeakCanary( 1642): |   mEatenAccessibilityChangeFlags = 0
12-13 15:08:26.875 D/LeakCanary( 1642): |   mFirstLayoutComplete = true
12-13 15:08:26.875 D/LeakCanary( 1642): |   mHasFixedSize = false
12-13 15:08:26.875 D/LeakCanary( 1642): |   mIgnoreMotionEventTillDown = false
12-13 15:08:26.875 D/LeakCanary( 1642): |   mInitialTouchX = 346
12-13 15:08:26.875 D/LeakCanary( 1642): |   mInitialTouchY = 1293
12-13 15:08:26.875 D/LeakCanary( 1642): |   mIsAttached = false
12-13 15:08:26.875 D/LeakCanary( 1642): |   mItemAnimator = android.support.v7.widget.DefaultItemAnimator@315199296 (0x12c98f40)
12-13 15:08:26.875 D/LeakCanary( 1642): |   mItemAnimatorListener = android.support.v7.widget.RecyclerView$ItemAnimatorRestoreListener@314580896 (0x12c01fa0)
12-13 15:08:26.875 D/LeakCanary( 1642): |   mItemAnimatorRunner = android.support.v7.widget.RecyclerView$2@314580912 (0x12c01fb0)
12-13 15:08:26.875 D/LeakCanary( 1642): |   mItemDecorations = java.util.ArrayList@316910656 (0x12e3ac40)
12-13 15:08:26.875 D/LeakCanary( 1642): |   mItemsAddedOrRemoved = false
12-13 15:08:26.875 D/LeakCanary( 1642): |   mItemsChanged = false
12-13 15:08:26.875 D/LeakCanary( 1642): |   mLastTouchX = 346
12-13 15:08:26.875 D/LeakCanary( 1642): |   mLastTouchY = 1293
12-13 15:08:26.875 D/LeakCanary( 1642): |   mLayout = android.support.v7.widget.LinearLayoutManager@316926400 (0x12e3e9c0)
12-13 15:08:26.875 D/LeakCanary( 1642): |   mLayoutFrozen = false
12-13 15:08:26.875 D/LeakCanary( 1642): |   mLayoutOrScrollCounter = 0
12-13 15:08:26.875 D/LeakCanary( 1642): |   mLayoutRequestEaten = false
12-13 15:08:26.875 D/LeakCanary( 1642): |   mLeftGlow = null
12-13 15:08:26.875 D/LeakCanary( 1642): |   mMaxFlingVelocity = 28000
12-13 15:08:26.875 D/LeakCanary( 1642): |   mMinFlingVelocity = 175
12-13 15:08:26.876 D/LeakCanary( 1642): |   mMinMaxLayoutPositions = int[2]@316910688 (0x12e3ac60)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mNestedOffsets = int[2]@316910720 (0x12e3ac80)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mObserver = android.support.v7.widget.RecyclerView$RecyclerViewDataObserver@314580928 (0x12c01fc0)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mOnChildAttachStateListeners = null
12-13 15:08:26.876 D/LeakCanary( 1642): |   mOnFlingListener = null
12-13 15:08:26.876 D/LeakCanary( 1642): |   mOnItemTouchListeners = java.util.ArrayList@316910752 (0x12e3aca0)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mPendingAccessibilityImportanceChange = java.util.ArrayList@316910784 (0x12e3acc0)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mPendingSavedState = null
12-13 15:08:26.876 D/LeakCanary( 1642): |   mPostedAnimatorRunner = false
12-13 15:08:26.876 D/LeakCanary( 1642): |   mPreserveFocusAfterLayout = true
12-13 15:08:26.876 D/LeakCanary( 1642): |   mRecycler = android.support.v7.widget.RecyclerView$Recycler@316914800 (0x12e3bc70)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mRecyclerListener = null
12-13 15:08:26.876 D/LeakCanary( 1642): |   mRightGlow = null
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollConsumed = int[2]@316910816 (0x12e3ace0)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollFactor = 1.4E-45
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollListener = null
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollListeners = null
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollOffset = int[2]@316910848 (0x12e3ad00)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollPointerId = 0
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollState = 0
12-13 15:08:26.876 D/LeakCanary( 1642): |   mScrollingChildHelper = android.support.v4.view.NestedScrollingChildHelper@316910880 (0x12e3ad20)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mState = android.support.v7.widget.RecyclerView$State@316918016 (0x12e3c900)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mTempRect = android.graphics.Rect@316910912 (0x12e3ad40)
12-13 15:08:26.876 D/LeakCanary( 1642): |   mTempRect2 = android.graphics.Rect@316910944 (0x12e3ad60)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mTempRectF = android.graphics.RectF@316910976 (0x12e3ad80)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mTopGlow = null
12-13 15:08:26.877 D/LeakCanary( 1642): |   mTouchSlop = 28
12-13 15:08:26.877 D/LeakCanary( 1642): |   mUpdateChildViewsRunnable = android.support.v7.widget.RecyclerView$1@314580944 (0x12c01fd0)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mVelocityTracker = android.view.VelocityTracker@316911008 (0x12e3ada0)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mViewFlinger = android.support.v7.widget.RecyclerView$ViewFlinger@316911040 (0x12e3adc0)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mViewInfoProcessCallback = android.support.v7.widget.RecyclerView$4@314580960 (0x12c01fe0)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mViewInfoStore = android.support.v7.widget.ViewInfoStore@314580976 (0x12c01ff0)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mViewPrefetcher = android.support.v7.widget.RecyclerView$ViewPrefetcher@316911072 (0x12e3ade0)
12-13 15:08:26.877 D/LeakCanary( 1642): |   mAnimationListener = null
12-13 15:08:26.877 D/LeakCanary( 1642): |   mCachePaint = null
12-13 15:08:26.877 D/LeakCanary( 1642): |   mChildAcceptsDrag = false
12-13 15:08:26.877 D/LeakCanary( 1642): |   mChildCountWithTransientState = 0
12-13 15:08:26.877 D/LeakCanary( 1642): |   mChildTransformation = null
12-13 15:08:26.877 D/LeakCanary( 1642): |   mChildren = android.view.View[12]@316918080 (0x12e3c940)
12-13 15:08:26.878 D/LeakCanary( 1642): |   mChildrenCount = 2
12-13 15:08:26.878 D/LeakCanary( 1642): |   mCurrentDrag = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mCurrentDragView = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mDisappearingChildren = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mDragNotifiedChildren = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mFirstHoverTarget = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mFirstTouchTarget = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mFocused = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mGroupFlags = 2375763
12-13 15:08:26.878 D/LeakCanary( 1642): |   mHoveredSelf = false
12-13 15:08:26.878 D/LeakCanary( 1642): |   mInvalidateRegion = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mInvalidationTransformation = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mLastTouchDownIndex = -1
12-13 15:08:26.878 D/LeakCanary( 1642): |   mLastTouchDownTime = 0
12-13 15:08:26.878 D/LeakCanary( 1642): |   mLastTouchDownX = 346.0
12-13 15:08:26.878 D/LeakCanary( 1642): |   mLastTouchDownY = 1293.0
12-13 15:08:26.878 D/LeakCanary( 1642): |   mLayoutAnimationController = null
12-13 15:08:26.878 D/LeakCanary( 1642): |   mLayoutCalledWhileSuppressed = false
12-13 15:08:26.879 D/LeakCanary( 1642): |   mLayoutMode = -1
12-13 15:08:26.879 D/LeakCanary( 1642): |   mLayoutTransitionListener = android.view.ViewGroup$2@317091952 (0x12e67070)
12-13 15:08:26.879 D/LeakCanary( 1642): |   mLocalPoint = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mNestedScrollAxes = 0
12-13 15:08:26.879 D/LeakCanary( 1642): |   mOnHierarchyChangeListener = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mPersistentDrawingCache = 2
12-13 15:08:26.879 D/LeakCanary( 1642): |   mPreSortedChildren = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mSuppressLayout = false
12-13 15:08:26.879 D/LeakCanary( 1642): |   mTempPoint = float[2]@316911104 (0x12e3ae00)
12-13 15:08:26.879 D/LeakCanary( 1642): |   mTransientIndices = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mTransientViews = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mTransition = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mTransitioningViews = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mVisibilityChangingChildren = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mAccessibilityCursorPosition = -1
12-13 15:08:26.879 D/LeakCanary( 1642): |   mAccessibilityDelegate = android.support.v4.view.AccessibilityDelegateCompatJellyBean$1@317091968 (0x12e67080)
12-13 15:08:26.879 D/LeakCanary( 1642): |   mAccessibilityTraversalAfterId = -1
12-13 15:08:26.879 D/LeakCanary( 1642): |   mAccessibilityTraversalBeforeId = -1
12-13 15:08:26.879 D/LeakCanary( 1642): |   mAccessibilityViewId = -1
12-13 15:08:26.879 D/LeakCanary( 1642): |   mAnimator = null
12-13 15:08:26.879 D/LeakCanary( 1642): |   mAttachInfo = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mAttributes = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mBackground = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mBackgroundRenderNode = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mBackgroundResource = 0
12-13 15:08:26.880 D/LeakCanary( 1642): |   mBackgroundSizeChanged = true
12-13 15:08:26.880 D/LeakCanary( 1642): |   mBackgroundTint = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mBottom = 2112
12-13 15:08:26.880 D/LeakCanary( 1642): |   mCachingFailed = false
12-13 15:08:26.880 D/LeakCanary( 1642): |   mClipBounds = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mContentDescription = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mContext = com.blueapron.mobile.ui.MainActivity@314783456 (0x12c336e0)
12-13 15:08:26.880 D/LeakCanary( 1642): |   mCurrentAnimation = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mDrawableState = int[2]@1874654592 (0x6fbcf580)
12-13 15:08:26.880 D/LeakCanary( 1642): |   mDrawingCache = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mDrawingCacheBackgroundColor = 0
12-13 15:08:26.880 D/LeakCanary( 1642): |   mFloatingTreeObserver = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mForegroundInfo = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mGhostView = null
12-13 15:08:26.880 D/LeakCanary( 1642): |   mHasPerformedLongPress = false
12-13 15:08:26.880 D/LeakCanary( 1642): |   mID = 2131624065
12-13 15:08:26.880 D/LeakCanary( 1642): |   mIgnoreNextUpEvent = false
12-13 15:08:26.880 D/LeakCanary( 1642): |   mInContextButtonPress = false
12-13 15:08:26.881 D/LeakCanary( 1642): |   mInputEventConsistencyVerifier = null
12-13 15:08:26.881 D/LeakCanary( 1642): |   mKeyedTags = android.util.SparseArray@316911136 (0x12e3ae20)
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLabelForId = -1
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLastIsOpaque = false
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLayerPaint = null
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLayerType = 0
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLayoutInsets = null
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLayoutParams = android.support.v4.view.ViewPager$LayoutParams@316914848 (0x12e3bca0)
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLeft = 0
12-13 15:08:26.881 D/LeakCanary( 1642): |   mLeftPaddingDefined = false
12-13 15:08:26.881 D/LeakCanary( 1642): |   mListenerInfo = null
12-13 15:08:26.881 D/LeakCanary( 1642): |   mMatchIdPredicate = null
12-13 15:08:26.881 D/LeakCanary( 1642): |   mMatchLabelForPredicate = null
12-13 15:08:26.881 D/LeakCanary( 1642): |   mMeasureCache = android.util.LongSparseLongArray@316911168 (0x12e3ae40)
12-13 15:08:26.881 D/LeakCanary( 1642): |   mMeasuredHeight = 2112
12-13 15:08:26.881 D/LeakCanary( 1642): |   mMeasuredWidth = 1440
12-13 15:08:26.881 D/LeakCanary( 1642): |   mMinHeight = 0
12-13 15:08:26.881 D/LeakCanary( 1642): |   mMinWidth = 0
12-13 15:08:26.881 D/LeakCanary( 1642): |   mNestedScrollingParent = null
12-13 15:08:26.881 D/LeakCanary( 1642): |   mNextFocusDownId = -1
12-13 15:08:26.881 D/LeakCanary( 1642): |   mNextFocusForwardId = -1
12-13 15:08:26.882 D/LeakCanary( 1642): |   mNextFocusLeftId = -1
12-13 15:08:26.882 D/LeakCanary( 1642): |   mNextFocusRightId = -1
12-13 15:08:26.882 D/LeakCanary( 1642): |   mNextFocusUpId = -1
12-13 15:08:26.882 D/LeakCanary( 1642): |   mOldHeightMeasureSpec = 1073743936
12-13 15:08:26.882 D/LeakCanary( 1642): |   mOldWidthMeasureSpec = 1073743264
12-13 15:08:26.882 D/LeakCanary( 1642): |   mOutlineProvider = android.view.ViewOutlineProvider$1@1874649728 (0x6fbce280)
12-13 15:08:26.882 D/LeakCanary( 1642): |   mOverScrollMode = 1
12-13 15:08:26.882 D/LeakCanary( 1642): |   mOverlay = null
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPaddingBottom = 0
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPaddingLeft = 0
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPaddingRight = 0
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPaddingTop = 0
12-13 15:08:26.882 D/LeakCanary( 1642): |   mParent = null
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPendingCheckForLongPress = null
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPendingCheckForTap = null
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPerformClick = null
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPrivateFlags = -2127947760
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPrivateFlags2 = 1611867688
12-13 15:08:26.882 D/LeakCanary( 1642): |   mPrivateFlags3 = 16
12-13 15:08:26.882 D/LeakCanary( 1642): |   mRecreateDisplayList = false
12-13 15:08:26.883 D/LeakCanary( 1642): |   mRenderNode = android.view.RenderNode@316911200 (0x12e3ae60)
12-13 15:08:26.883 D/LeakCanary( 1642): |   mResources = android.content.res.Resources@316926480 (0x12e3ea10)
12-13 15:08:26.883 D/LeakCanary( 1642): |   mRight = 1440
12-13 15:08:26.883 D/LeakCanary( 1642): |   mRightPaddingDefined = false
12-13 15:08:26.883 D/LeakCanary( 1642): |   mScrollCache = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mScrollIndicatorDrawable = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mScrollX = 0
12-13 15:08:26.883 D/LeakCanary( 1642): |   mScrollY = 0
12-13 15:08:26.883 D/LeakCanary( 1642): |   mSendViewScrolledAccessibilityEvent = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mSendViewStateChangedAccessibilityEvent = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mSendingHoverAccessibilityEvents = false
12-13 15:08:26.883 D/LeakCanary( 1642): |   mStartActivityRequestWho = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mStateListAnimator = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mSystemUiVisibility = 0
12-13 15:08:26.883 D/LeakCanary( 1642): |   mTag = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mTempNestedScrollConsumed = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mTop = 0
12-13 15:08:26.883 D/LeakCanary( 1642): |   mTouchDelegate = null
12-13 15:08:26.883 D/LeakCanary( 1642): |   mTouchSlop = 28
12-13 15:08:26.883 D/LeakCanary( 1642): |   mTransformationInfo = android.view.View$TransformationInfo@316911232 (0x12e3ae80)
12-13 15:08:26.883 D/LeakCanary( 1642): |   mTransientStateCount = 0
12-13 15:08:26.884 D/LeakCanary( 1642): |   mTransitionName = null
3

There are 3 answers

0
mortalis On

I had this tree with excluded leak:

AudioManager.mContext_static (excluded)
|
ContextImpl.mOuterContext
|
MyAudioActivity

Under the first element it shows info:

Excluded by rule AUDIO_MANAGER__MCONTEXT_STATIC ...
... because Samsung added a static mContext_static field to AudioManager, holds a reference to the activity

Then in the LeakCanary FAQ I found this page:

https://github.com/square/leakcanary/wiki/FAQ#can-a-leak-be-caused-by-the-android-sdk

Which explains that some leaks cannot be fixed by the developer. It points to the AndroidExcludedRefs.java file which has the mentioned AUDIO_MANAGER__MCONTEXT_STATIC entry.

3
humble_wolf On

I hope you have already got the reason, but for anyone else reading this post in future, the reason I think for showing excluded and known leak is :-

  • to notify you that something bad but known is happening and
  • to show you the hack/fix/track available to avoid this leak.
0
MikeL On

It seems that LeakCanary intentionally show the notification because removing them is bad behavior for some users and they are looking into making this clearer.

Clarify what "excluded leaks" are about:

Initially we were hidden the excluded leaks but then people would complain that they'd see the VM freeze and couldn't find the leak afterwards.