Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak #24

Closed
DanielNovak opened this issue Jun 2, 2015 · 2 comments
Closed

Memory leak #24

DanielNovak opened this issue Jun 2, 2015 · 2 comments
Assignees

Comments

@DanielNovak
Copy link

I have used Square's LeakCanary and I got this after rotating the screen:

In com.sample.esource:dev:0.
* im.dino.dbinspector.activities.DbInspectorActivity 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[].[0]
* references java.util.HashMap$HashMapEntry.key
* references im.dino.dbinspector.fragments.TableListFragment$2.this$0 (anonymous class extends android.content.BroadcastReceiver)
* references im.dino.dbinspector.fragments.TableListFragment.adapter
* references android.widget.ArrayAdapter.mContext
* leaks im.dino.dbinspector.activities.DbInspectorActivity instance

* Reference Key: 0fc69135-029d-4cdd-8820-23a61819907e
* Device: motorola motorola XT1032 falcon_retde
* Android Version: 5.0.2 API: 21 LeakCanary: 1.3.1
* Durations: watch=5342ms, gc=174ms, heap dump=2491ms, analysis=30190ms

* Details:
* Class android.support.v4.content.LocalBroadcastManager
|   static $staticOverhead = byte[] [id=0x12cf1b01;length=40;size=56]
|   static TAG = java.lang.String [id=0x12f8bce0]
|   static mInstance = android.support.v4.content.LocalBroadcastManager [id=0x12f8bd00]
|   static mLock = java.lang.Object [id=0x12f2ea80]
|   static DEBUG = false
|   static MSG_EXEC_PENDING_BROADCASTS = 1
* Instance of android.support.v4.content.LocalBroadcastManager
|   static $staticOverhead = byte[] [id=0x12cf1b01;length=40;size=56]
|   static TAG = java.lang.String [id=0x12f8bce0]
|   static mInstance = android.support.v4.content.LocalBroadcastManager [id=0x12f8bd00]
|   static mLock = java.lang.Object [id=0x12f2ea80]
|   static DEBUG = false
|   static MSG_EXEC_PENDING_BROADCASTS = 1
|   mActions = java.util.HashMap [id=0x12f87f10]
|   mAppContext = com.sample.esource.App [id=0x12cea160]
|   mHandler = android.support.v4.content.LocalBroadcastManager$1 [id=0x12f8bd40]
|   mPendingBroadcasts = java.util.ArrayList [id=0x12f8bd20]
|   mReceivers = java.util.HashMap [id=0x12f87ee0]
* Instance of java.util.HashMap
|   static $staticOverhead = byte[] [id=0x70912ac1;length=48;size=64]
|   static EMPTY_TABLE = java.util.HashMap$HashMapEntry[] [id=0x71308200;length=2]
|   static serialPersistentFields = java.io.ObjectStreamField[] [id=0x71308218;length=1]
|   static DEFAULT_LOAD_FACTOR = 0.75
|   static serialVersionUID = 362498820763181265
|   static MAXIMUM_CAPACITY = 1073741824
|   static MINIMUM_CAPACITY = 4
|   entryForNullKey = null
|   entrySet = null
|   keySet = null
|   table = java.util.HashMap$HashMapEntry[] [id=0x12f8be00;length=4]
|   values = null
|   modCount = 4
|   size = 4
|   threshold = 3
|   keySet = null
|   valuesCollection = null
* Array of java.util.HashMap$HashMapEntry[]
|   [0] = java.util.HashMap$HashMapEntry [id=0x12f8be20]
|   [1] = java.util.HashMap$HashMapEntry [id=0x12c4f3e0]
|   [2] = null
|   [3] = java.util.HashMap$HashMapEntry [id=0x12c0ce60]
* Instance of java.util.HashMap$HashMapEntry
|   key = im.dino.dbinspector.fragments.TableListFragment$2 [id=0x12f890c0]
|   next = null
|   value = java.util.ArrayList [id=0x12f8bde0]
|   hash = -1208629200
* Instance of im.dino.dbinspector.fragments.TableListFragment$2
|   this$0 = im.dino.dbinspector.fragments.TableListFragment [id=0x12f5d8f0]
|   mPendingResult = null
|   mDebugUnregister = false
* Instance of im.dino.dbinspector.fragments.TableListFragment
|   static $staticOverhead = byte[] [id=0x12e68801;length=8;size=24]
|   static KEY_DATABASE = java.lang.String [id=0x12f88fc0]
|   adapter = android.widget.ArrayAdapter [id=0x12c90ec0]
|   database = java.io.File [id=0x12f2aa70]
|   dbCopiedReceiver = im.dino.dbinspector.fragments.TableListFragment$2 [id=0x12f890c0]
|   tableClickListener = im.dino.dbinspector.fragments.TableListFragment$1 [id=0x12f2e980]
|   mAdapter = android.widget.ArrayAdapter [id=0x12c90ec0]
|   mEmptyText = null
|   mEmptyView = null
|   mHandler = android.os.Handler [id=0x12f89080]
|   mList = null
|   mListContainer = null
|   mOnClickListener = android.support.v4.app.ListFragment$2 [id=0x12f2e930]
|   mProgressContainer = null
|   mRequestFocus = android.support.v4.app.ListFragment$1 [id=0x12f2e920]
|   mStandardEmptyView = null
|   mListShown = false
|   mActivity = null
|   mAllowEnterTransitionOverlap = null
|   mAllowReturnTransitionOverlap = null
|   mAnimatingAway = null
|   mArguments = android.os.Bundle [id=0x12f88fe0]
|   mChildFragmentManager = null
|   mContainer = null
|   mEnterTransition = null
|   mEnterTransitionCallback = null
|   mExitTransition = null
|   mExitTransitionCallback = null
|   mFragmentManager = null
|   mInnerView = null
|   mLoaderManager = null
|   mParentFragment = null
|   mReenterTransition = java.lang.Object [id=0x12dc9e70]
|   mReturnTransition = java.lang.Object [id=0x12dc9e70]
|   mSavedFragmentState = null
|   mSavedViewState = android.util.SparseArray [id=0x12e05ac0]
|   mSharedElementEnterTransition = null
|   mSharedElementReturnTransition = java.lang.Object [id=0x12dc9e70]
|   mTag = null
|   mTarget = null
|   mView = null
|   mWho = null
|   mAdded = false
|   mBackStackNesting = 0
|   mCalled = true
|   mCheckedForLoaderManager = false
|   mContainerId = 0
|   mDeferStart = false
|   mDetached = false
|   mFragmentId = 0
|   mFromLayout = false
|   mHasMenu = true
|   mHidden = false
|   mInLayout = false
|   mIndex = -1
|   mLoadersStarted = false
|   mMenuVisible = true
|   mNextAnim = 0
|   mRemoving = false
|   mRestored = false
|   mResumed = false
|   mRetainInstance = false
|   mRetaining = false
|   mState = 0
|   mStateAfterAnimating = 0
|   mTargetIndex = -1
|   mTargetRequestCode = 0
|   mUserVisibleHint = true
* Instance of android.widget.ArrayAdapter
|   mContext = im.dino.dbinspector.activities.DbInspectorActivity [id=0x12d51bc0]
|   mFilter = null
|   mInflater = com.android.internal.policy.impl.PhoneLayoutInflater [id=0x12f64310]
|   mLock = java.lang.Object [id=0x12c765a0]
|   mObjects = java.util.ArrayList [id=0x12dda140]
|   mOriginalValues = null
|   mDropDownResource = 17367043
|   mFieldId = 0
|   mNotifyOnChange = true
|   mResource = 17367043
|   mDataSetObservable = android.database.DataSetObservable [id=0x12c76590]
* Instance of im.dino.dbinspector.activities.DbInspectorActivity
|   mDelegate = android.support.v7.app.AppCompatDelegateImplV11 [id=0x12ca2fc0]
|   mAllLoaderManagers = android.support.v4.util.SimpleArrayMap [id=0x12f7ec80]
|   mContainer = android.support.v4.app.FragmentActivity$2 [id=0x12f429f0]
|   mFragments = android.support.v4.app.FragmentManagerImpl [id=0x12f4bc10]
|   mHandler = android.support.v4.app.FragmentActivity$1 [id=0x12f272e0]
|   mLoaderManager = null
|   mCheckedForLoaderManager = true
|   mCreated = true
|   mLoadersStarted = false
|   mOptionsMenuInvalidated = false
|   mReallyStopped = true
|   mResumed = false
|   mRetaining = true
|   mStopped = true
|   mActionBar = null
|   mActivityInfo = android.content.pm.ActivityInfo [id=0x12f65080]
|   mActivityTransitionState = android.app.ActivityTransitionState [id=0x12f5acc0]
|   mAllLoaderManagers = android.util.ArrayMap [id=0x12f75160]
|   mApplication = com.sample.esource.App [id=0x12cea160]
|   mComponent = android.content.ComponentName [id=0x12c7b0f0]
|   mContainer = android.app.Activity$1 [id=0x12f429c0]
|   mCurrentConfig = android.content.res.Configuration [id=0x12f4bd60]
|   mDecor = null
|   mDefaultKeySsb = null
|   mEmbeddedID = null
|   mEnterTransitionListener = android.app.SharedElementCallback$1 [id=0x71321398]
|   mExitTransitionListener = android.app.SharedElementCallback$1 [id=0x71321398]
|   mFragments = android.app.FragmentManagerImpl [id=0x12f4bba0]
|   mHandler = android.os.Handler [id=0x12f272c0]
|   mInstanceTracker = android.os.StrictMode$InstanceTracker [id=0x12f429d0]
|   mInstrumentation = android.app.Instrumentation [id=0x12c0e1a0]
|   mIntent = android.content.Intent [id=0x12f02140]
|   mLastNonConfigurationInstances = null
|   mLoaderManager = null
|   mMainThread = android.app.ActivityThread [id=0x12c51100]
|   mManagedCursors = java.util.ArrayList [id=0x12f27280]
|   mManagedDialogs = null
|   mMenuInflater = null
|   mParent = null
|   mResultData = null
|   mSearchManager = null
|   mTitle = java.lang.String [id=0x12f27400]
|   mToken = android.os.BinderProxy [id=0x12c78440]
|   mTranslucentCallback = null
|   mUiThread = java.lang.Thread [id=0x745d1480]
|   mVoiceInteractor = null
|   mWindow = com.android.internal.policy.impl.PhoneWindow [id=0x12d0b280]
|   mWindowManager = android.view.WindowManagerImpl [id=0x12f27520]
|   mCalled = true
|   mChangeCanvasToTranslucent = false
|   mChangingConfigurations = true
|   mCheckedForLoaderManager = true
|   mConfigChangeFlags = 1152
|   mDefaultKeyMode = 0
|   mDestroyed = true
|   mDoReportFullyDrawn = false
|   mEnableDefaultActionBarUp = false
|   mFinished = false
|   mIdent = 51785090
|   mLoadersStarted = false
|   mResultCode = 0
|   mResumed = false
|   mStartedActivity = false
|   mStopped = true
|   mTemporaryPause = false
|   mTitleColor = 0
|   mTitleReady = true
|   mVisibleBehind = false
|   mVisibleFromClient = true
|   mVisibleFromServer = true
|   mWindowAdded = true
|   mInflater = com.android.internal.policy.impl.PhoneLayoutInflater [id=0x12f64310]
|   mOverrideConfiguration = null
|   mResources = android.content.res.Resources [id=0x12c0e100]
|   mTheme = android.content.res.Resources$Theme [id=0x12f27540]
|   mThemeResource = 2131296480
|   mBase = android.app.ContextImpl [id=0x12eced80]
@reisub reisub self-assigned this Jun 2, 2015
@reisub
Copy link
Contributor

reisub commented Jun 2, 2015

Hi @DanielNovak,
thanks for reporting this, we'll fix it in the near future.

@reisub
Copy link
Contributor

reisub commented Jun 2, 2015

Note to self:
We need to unregister the broadcast receiver in TableListFragment.

reisub pushed a commit that referenced this issue Jun 2, 2015
@reisub reisub closed this as completed Jun 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants