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

Leak memory found #79

Closed
CQBinh opened this issue Nov 28, 2015 · 7 comments
Closed

Leak memory found #79

CQBinh opened this issue Nov 28, 2015 · 7 comments

Comments

@CQBinh
Copy link

CQBinh commented Nov 28, 2015

I use leakcanary and see this leak:

11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: In com.my.app:1.3.1:19.
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * com.my.app.MainActivity has leaked:
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * GC ROOT static hotchemi.android.rate.AppRate.singleton
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * references hotchemi.android.rate.AppRate.options
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * references hotchemi.android.rate.DialogOptions.listener
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * references com.my.app.MainActivity$3.this$0 (anonymous class implements hotchemi.android.rate.OnClickButtonListener)
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * leaks com.my.app.MainActivity instance
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Reference Key: 75c07244-8e76-41d0-969b-c8fa9eb2558e
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Device: asus asus ASUS_T00J WW_a501cg
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Android Version: 4.4.2 API: 19 LeakCanary: 1.3.1
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Durations: watch=5024ms, gc=148ms, heap dump=1009ms, analysis=12724ms
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Details:
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Class hotchemi.android.rate.AppRate
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   static $staticOverhead = byte[] [id=0x43da10e1;length=24;size=40]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   static singleton = hotchemi.android.rate.AppRate [id=0x43c25230]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Instance of hotchemi.android.rate.AppRate
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   static $staticOverhead = byte[] [id=0x43da10e1;length=24;size=40]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   static singleton = hotchemi.android.rate.AppRate [id=0x43c25230]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   context = com.my.app.BLApplication [id=0x43a123f0]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   options = hotchemi.android.rate.DialogOptions [id=0x43c07150]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   installDate = 0
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   isDebug = true
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   launchTimes = 5
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   eventsTimes = -1
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   remindInterval = 5
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Instance of hotchemi.android.rate.DialogOptions
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   view = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   listener = com.my.app.MainActivity$3 [id=0x43bf6fe0]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   messageResId = 2131099699
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   showNeutralButton = true
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   showTitle = true
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   textNegativeResId = 2131099700
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   textNeutralResId = 2131099698
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   textPositiveResId = 2131099701
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   titleResId = 2131099702
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   cancelable = false
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Instance of com.my.app.MainActivity$3
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   this$0 = com.my.app.MainActivity [id=0x43cd0130]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: * Instance of com.my.app.MainActivity
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   static $staticOverhead = byte[] [id=0x440454e1;length=24;size=40]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   static $assertionsDisabled = true
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   backButtonCallback = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   homeFragment = com.my.app.fragments.commons.HomeFragment [id=0x43fba7d0]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   mSlidingMenu = com.jeremyfeinstein.slidingmenu.lib.SlidingMenu [id=0x43bed010]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   uiHelper = com.facebook.UiLifecycleHelper [id=0x43d2f430]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   TAG = java.lang.String [id=0x43e7c380]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   actionbar = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   bundle = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   loadingDialog = com.my.app.abtracts.BLLoadingDialog [id=0x43d187c0]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   numberLoadingDialog = java.util.concurrent.atomic.AtomicInteger [id=0x43f3dab0]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   topicId = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   topicName = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   TAG = java.lang.String [id=0x43e75170]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   activityCallback = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   mAllLoaderManagers = android.support.v4.util.SimpleArrayMap [id=0x43da3f60]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   mLoaderManager = null
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   mContainer = android.support.v4.app.FragmentActivity$2 [id=0x43cc3150]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   mHandler = android.support.v4.app.FragmentActivity$1 [id=0x43e75140]
11-29 00:20:00.645 19945-21301/com.my.app D/LeakCanary: |   mFragments = android.support.v4.app.FragmentManagerImpl [id=0x43e7c310]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mCreated = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mCheckedForLoaderManager = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mLoadersStarted = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mOptionsMenuInvalidated = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mReallyStopped = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mResumed = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mRetaining = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mStopped = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mActionBar = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mActivityInfo = android.content.pm.ActivityInfo [id=0x43e51510]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mAllLoaderManagers = android.util.ArrayMap [id=0x43d4a0e0]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mApplication = com.my.app.BLApplication [id=0x43a123f0]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mWindowManager = android.view.WindowManagerImpl [id=0x43da53e0]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mWindow = com.android.internal.policy.impl.PhoneWindow [id=0x43ee0d80]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mUiThread = java.lang.Thread [id=0x430f4340]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mTranslucentCallback = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mComponent = android.content.ComponentName [id=0x439fe320]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mToken = android.os.BinderProxy [id=0x439fe2c0]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mContainer = android.app.Activity$1 [id=0x43e6f1e0]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mCurrentConfig = android.content.res.Configuration [id=0x43edc8e0]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mDecor = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mTitle = java.lang.String [id=0x43a53a00]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mDefaultKeySsb = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mSearchManager = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mResultData = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mParent = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mEmbeddedID = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mMenuInflater = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mManagedDialogs = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mFragments = android.app.FragmentManagerImpl [id=0x43e75060]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mHandler = android.os.Handler [id=0x43e75120]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mManagedCursors = java.util.ArrayList [id=0x43e750d0]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mInstanceTracker = android.os.StrictMode$InstanceTracker [id=0x43e16f60]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mInstrumentation = android.app.Instrumentation [id=0x43a10c00]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mIntent = android.content.Intent [id=0x43a07970]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mLastNonConfigurationInstances = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mLoaderManager = null
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mMainThread = android.app.ActivityThread [id=0x43a0cf90]
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mLoadersStarted = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mIdent = 582202416
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mFinished = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mEnableDefaultActionBarUp = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mDoReportFullyDrawn = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mResultCode = 0
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mDisplayId = 0
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mResumed = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mDestroyed = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mStartedActivity = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mStopped = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mTemporaryPause = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mDefaultKeyMode = 0
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mTitleColor = 0
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mTitleReady = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mConfigChangeFlags = 0
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mCheckedForLoaderManager = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mChangingConfigurations = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mVisibleFromClient = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mVisibleFromServer = true
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mChangeCanvasToTranslucent = false
11-29 00:20:00.655 19945-21301/com.my.app D/LeakCanary: |   mWindowAdded = true
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mCalled = true
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mBase = android.app.ContextImpl [id=0x43e7c3a0]
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mInflater = com.android.internal.policy.impl.PhoneLayoutInflater [id=0x43f1edb0]
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mOverrideConfiguration = null
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mResources = android.content.res.Resources [id=0x43a0fe40]
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mTheme = android.content.res.Resources$Theme [id=0x43da5400]
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mThemeResource = 2131230843
11-29 00:20:00.665 19945-21301/com.my.app D/LeakCanary: |   mBase = android.app.ContextImpl [id=0x43e7c3a0]
@hotchemi
Copy link
Owner

hotchemi commented Dec 1, 2015

Thanks.

@iRYO400
Copy link

iRYO400 commented Feb 9, 2016

Did you solve it?

@hotchemi
Copy link
Owner

hotchemi commented Feb 9, 2016

Ah sorry not yet. Are you in trouble with that?

@iRYO400
Copy link

iRYO400 commented Feb 9, 2016

I haven't checked that, because I don't know how to use leakcanary

@hotchemi
Copy link
Owner

@iRYO400 I welcome your pr:D

@Gazer
Copy link

Gazer commented Mar 8, 2016

Adding a AppRate.detach() method will be enough? So we can call it in the Activity#onDestroy method. If its ok I've no problem on send a PR!, let me know.

Thanks!

Edit : I've created a PR #94 to solve this.

@hotchemi
Copy link
Owner

@Gazer Sorry I reverted your pr. This issue is will be fixed in 1.0.0. Thx for you report.

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

4 participants