内存泄露
首次进入BoostFlutterActivity界面然后退出,返回native存在内存泄露
麻烦提供详细信息
麻烦提供详细信息
这是LeakCanary的记录 In com.dankegongyu.employee:1.8.0:70.
-
com.dankegongyu.salein.business.change.ContractChangeActivity has leaked:
-
static MessengerFacade.!(instance)!
-
↳ MessengerFacade.!(messenger)!
-
↳ BoostFlutterNativeView.!(mFlutterView)!
-
↳ BoostFlutterView.mContext
-
↳ ContractChangeActivity
-
Reference Key: 585ca09e-c57a-4986-9828-0e0dea4171db
-
Device: HUAWEI HUAWEI HUAWEI NXT-AL10 NXT-AL10
-
Android Version: 8.0.0 API: 26 LeakCanary: 1.6.3 31007b4
-
Durations: watch=5011ms, gc=235ms, heap dump=1710ms, analysis=9982ms
-
Details:
-
Class fleamarket.taobao.com.xservicekit.message.MessengerFacade | static $classOverhead = byte[92]@325143049 (0x13614a09) | static instance = fleamarket.taobao.com.xservicekit.message.MessengerFacade@325185736 (0x1361f0c8)
-
Instance of fleamarket.taobao.com.xservicekit.message.MessengerFacade | static $classOverhead = byte[92]@325143049 (0x13614a09) | static instance = fleamarket.taobao.com.xservicekit.message.MessengerFacade@325185736 (0x1361f0c8) | mEventChannels = java.util.HashMap@325185776 (0x1361f0f0) | mMethodChannels = java.util.HashMap@325185816 (0x1361f118) | mPendingEventChannels = java.util.HashMap@325185856 (0x1361f140) | mPendingEventStreamHandlers = java.util.HashMap@325185896 (0x1361f168) | mPendingMethodChannels = java.util.HashMap@325185936 (0x1361f190) | mPendingMethodHandlers = java.util.HashMap@325185976 (0x1361f1b8) | messenger = com.taobao.idlefish.flutterboost.BoostFlutterNativeView@321210128 (0x13254710) | shadow$klass = fleamarket.taobao.com.xservicekit.message.MessengerFacade | shadow$monitor = 0
-
Instance of com.taobao.idlefish.flutterboost.BoostFlutterNativeView | static $classOverhead = byte[108]@321210217 (0x13254769) | applicationIsRunning = true | mContext = com.dankegongyu.shell.employee.ShellApplication@317919488 (0x12f31100) | mFlutterJNI = io.flutter.embedding.engine.FlutterJNI@321210448 (0x13254850) | mFlutterView = com.taobao.idlefish.flutterboost.BoostFlutterView@321210480 (0x13254870) | mMessageHandlers = java.util.HashMap@321211184 (0x13254b30) | mNextReplyId = 4 | mPendingReplies = java.util.HashMap@321211224 (0x13254b58) | mPluginRegistry = io.flutter.app.FlutterPluginRegistry@321211264 (0x13254b80) | shadow$klass = com.taobao.idlefish.flutterboost.BoostFlutterNativeView | shadow$monitor = 0
-
Instance of com.taobao.idlefish.flutterboost.BoostFlutterView | static $classOverhead = byte[3388]@318734257 (0x12ff7fb1) | mBoostCallback = com.taobao.idlefish.flutterboost.BoostFlutterView$BoostCallback@321246576 (0x1325d570) | mFirstFrameCalled = true | mResumed = false | androidKeyProcessor = io.flutter.embedding.engine.android.AndroidKeyProcessor@321246592 (0x1325d580) | dartExecutor = io.flutter.embedding.engine.dart.DartExecutor@321246608 (0x1325d590) | keyEventChannel = io.flutter.embedding.engine.systemchannels.KeyEventChannel@321246632 (0x1325d5a8) | lifecycleChannel = io.flutter.embedding.engine.systemchannels.LifecycleChannel@321246648 (0x1325d5b8) | mAccessibilityEnabled = false | mAccessibilityFeatureFlags = 0 | mAccessibilityManager = android.view.accessibility.AccessibilityManager@317919520 (0x12f31120) | mAccessibilityNodeProvider = null | mActivityLifecycleListeners = java.util.ArrayList@321246664 (0x1325d5c8) | mAnimationScaleObserver = io.flutter.view.FlutterView$AnimationScaleObserver@321246688 (0x1325d5e0) | mFirstFrameListeners = java.util.ArrayList@321246712 (0x1325d5f8) | mFlutterLocalizationChannel = io.flutter.plugin.common.MethodChannel@321246736 (0x1325d610) | mImm = android.view.inputmethod.InputMethodManager@317918296 (0x12f30c58) | mIsSoftwareRenderingEnabled = false | mLastInputConnection = null | mMetrics = io.flutter.view.FlutterView$ViewportMetrics@321246760 (0x1325d628) | mNativeView = com.taobao.idlefish.flutterboost.BoostFlutterNativeView@321210128 (0x13254710) | mSurfaceCallback = io.flutter.view.FlutterView$1@321246816 (0x1325d660) | mTextInputPlugin = io.flutter.plugin.editing.TextInputPlugin@321243896 (0x1325caf8) | mTouchExplorationEnabled = false | mTouchExplorationListener = io.flutter.view.FlutterView$TouchExplorationListener@321246832 (0x1325d670) | navigationChannel = io.flutter.embedding.engine.systemchannels.NavigationChannel@321246848 (0x1325d680) | nextTextureId = java.util.concurrent.atomic.AtomicLong@321246864 (0x1325d690) | settingsChannel = io.flutter.embedding.engine.systemchannels.SettingsChannel@321246880 (0x1325d6a0) | systemChannel = io.flutter.embedding.engine.systemchannels.SystemChannel@321246896 (0x1325d6b0) | mAttachedToWindow = false | mCallbacks = java.util.ArrayList@321246912 (0x1325d6c0) | mConfiguration = android.content.res.Configuration@321246936 (0x1325d6d8) | mDeferredDestroySurfaceControl = null | mDrawFinished = true | mDrawListener = android.view.SurfaceView$2@321247056 (0x1325d750) | mDrawingStopped = true | mFormat = 4 | mGlobalListenersAdded = false | mHaveFrame = false | mIsCreating = false | mLastLockTime = 0 | mLastSurfaceHeight = 1812 | mLastSurfaceWidth = 1080 | mLastWindowVisibility = false | mLocation = int[2]@321247072 (0x1325d760) | mPendingReportDraws = 0 | mRTLastReportedPosition = android.graphics.Rect@321247096 (0x1325d778) | mRequestedFormat = 4 | mRequestedHeight = -1 | mRequestedVisible = false | mRequestedWidth = -1 | mRtHandlingPositionUpdates = true | mScreenRect = android.graphics.Rect@321247120 (0x1325d790) | mScrollChangedListener = android.view.SurfaceView$1@321247144 (0x1325d7a8) | mSubLayer = -2 | mSurface = android.view.Surface@321247160 (0x1325d7b8) | mSurfaceControl = null | mSurfaceCreated = false | mSurfaceFlags = 1028 | mSurfaceFrame = android.graphics.Rect@321247224 (0x1325d7f8) | mSurfaceHeight = 1812 | mSurfaceHolder = android.view.SurfaceView$3@321247248 (0x1325d810) | mSurfaceLock = java.util.concurrent.locks.ReentrantLock@321247264 (0x1325d820) | mSurfaceSession = android.view.SurfaceSession@321247280 (0x1325d830) | mSurfaceWidth = 1080 | mTmpRect = android.graphics.Rect@321247296 (0x1325d840) | mTranslator = null | mViewVisibility = true | mVisible = false | mWindowSpaceLeft = 0 | mWindowSpaceTop = 0 | mWindowStopped = false | mWindowVisibility = false | mAccessibilityCursorPosition = -1 | mAccessibilityDelegate = null | mAccessibilityTraversalAfterId = -1 | mAccessibilityTraversalBeforeId = -1 | mAccessibilityViewId = -1 | mAnimator = null | mAttachInfo = null | mAttributes = null | mAutofillHints = null | mAutofillId = null | mAutofillViewId = -1 | mBackground = null | mBackgroundRenderNode = null | mBackgroundResource = 0 | mBackgroundSizeChanged = true | mBackgroundTint = null | mBottom = 1812 | mCachingFailed = false | mCanTouchInOtherThread = false | mClipBounds = null | mContentDescription = null | mContext = com.dankegongyu.salein.business.change.ContractChangeActivity@321211320 (0x13254bb8) | mCurrentAnimation = null | mDefaultFocusHighlight = null | mDefaultFocusHighlightCache = null | mDefaultFocusHighlightEnabled = true | mDefaultFocusHighlightSizeChanged = true | mDrawableState = int[3]@1890809360 (0x70b37610) | mDrawingCache = null | mDrawingCacheBackgroundColor = 0 | mFloatingTreeObserver = null | mForceRTL = false | mForegroundInfo = null | mFrameMetricsObservers = null | mGhostView = null | mHasPerformedLongPress = false | mHwStateListAnimator = null | mID = -1 | mIgnoreNextUpEvent = false | mInContextButtonPress = false | mInputEventConsistencyVerifier = null | mKeyedTags = null | mLabelForId = -1 | mLastIsOpaque = false | mLayerPaint = null | mLayerType = 0 | mLayoutInsets = null | mLayoutParams = android.widget.FrameLayout$LayoutParams@321247320 (0x1325d858) | mLeft = 0 | mLeftPaddingDefined = false | mListenerInfo = null | mLongClickX = NaN | mLongClickY = NaN | mMatchIdPredicate = null | mMatchLabelForPredicate = null | mMeasureCache = android.util.LongSparseLongArray@321247376 (0x1325d890) | mMeasuredHeight = 1812 | mMeasuredWidth = 1080 | mMinHeight = 0 | mMinWidth = 0 | mNestedScrollingParent = null | mNextClusterForwardId = -1 | mNextFocusDownId = -1 | mNextFocusForwardId = -1 | mNextFocusLeftId = -1 | mNextFocusRightId = -1 | mNextFocusUpId = -1 | mOldHeightMeasureSpec = 1073743636 | mOldWidthMeasureSpec = 1073742904 | mOutlineProvider = android.view.ViewOutlineProvider$1@1890609176 (0x70b06818) | mOverScrollMode = 1 | mOverlay = null | mPaddingBottom = 0 | mPaddingLeft = 0 | mPaddingRight = 0 | mPaddingTop = 0 | mParent = null | mPendingCheckForLongPress = null | mPendingCheckForTap = null | mPerformClick = null | mPointerIcon = null | mPrivateFlags = -2128606576 | mPrivateFlags2 = 1610819112 | mPrivateFlags3 = 0 | mRecreateDisplayList = false | mRenderNode = android.view.RenderNode@321247400 (0x1325d8a8) | mResources = android.content.res.HwResources@321214336 (0x13255780) | mRight = 1080 | mRightPaddingDefined = false | mRoundScrollbarRenderer = null | mRunQueue = null | mScrollCache = null | mScrollIndicatorDrawable = null | mScrollX = 0 | mScrollY = 0 | mSendViewScrolledAccessibilityEvent = null | mSendViewStateChangedAccessibilityEvent = null | mSendingHoverAccessibilityEvents = false | mStartActivityRequestWho = null | mStateListAnimator = null | mSystemUiVisibility = 0 | mTag = null | mTempNestedScrollConsumed = null | mTooltipInfo = null | mTop = 0 | mTouchDelegate = null | mTouchSlop = 24 | mTransformationInfo = android.view.View$TransformationInfo@321247424 (0x1325d8c0) | mTransientStateCount = 0 | mTransitionName = null | mUnscaledDrawingCache = null | mUnsetPressedState = null | mUserPaddingBottom = 0 | mUserPaddingEnd = -2147483648 | mUserPaddingLeft = 0 | mUserPaddingLeftInitial = 0 | mUserPaddingRight = 0 | mUserPaddingRightInitial = 0 | mUserPaddingStart = -2147483648 | mVerticalScrollFactor = 0.0 | mVerticalScrollbarPosition = 0 | mViewCheckedResult = 1 | mViewFlags = 402915457 | mVisibilityChangeForAutofillHandler = null | mWindowAttachCount = 1 | shadow$klass = com.taobao.idlefish.flutterboost.BoostFlutterView | shadow$monitor = -2136536941
-
Instance of com.dankegongyu.salein.business.change.ContractChangeActivity | static $classOverhead = byte[2008]@319354409 (0x1308f629) | mFlutterContent = com.taobao.idlefish.flutterboost.containers.BoostFlutterActivity$FlutterContent@321212472 (0x13255038) | delegate = io.flutter.app.FlutterActivityDelegate@321213144 (0x132552d8) | eventDelegate = io.flutter.app.FlutterActivityDelegate@321213144 (0x132552d8) | pluginRegistry = io.flutter.app.FlutterActivityDelegate@321213144 (0x132552d8) | viewProvider = io.flutter.app.FlutterActivityDelegate@321213144 (0x132552d8) | mActionBar = null | mActionModeTypeStarting = 0 | mActivityInfo = android.content.pm.ActivityInfo@321213168 (0x132552f0) | mActivityTransitionState = android.app.ActivityTransitionState@321213336 (0x13255398) | mApplication = com.dankegongyu.shell.employee.ShellApplication@317919488 (0x12f31100) | mAutoFillResetNeeded = false | mAutofillManager = null | mAutofillPopupWindow = null | mAwareService = null | mCalled = true | mChangeCanvasToTranslucent = false | mChangingConfigurations = false | mComponent = android.content.ComponentName@321213392 (0x132553d0) | mConfigChangeFlags = 0 | mCurrentConfig = android.content.res.Configuration@321213408 (0x132553e0) | mCustActivity = android.app.HwCustActivityImpl@321213528 (0x13255458) | mDecor = null | mDefaultKeyMode = 0 | mDefaultKeySsb = null | mDestroyed = true | mDoReportFullyDrawn = false | mEmbeddedID = null | mEnableDefaultActionBarUp = false | mEnterTransitionListener = android.app.SharedElementCallback$1@1890585752 (0x70b00c98) | mExitTransitionListener = android.app.SharedElementCallback$1@1890585752 (0x70b00c98) | mFinished = true | mFragments = android.app.FragmentController@321213552 (0x13255470) | mHandler = android.os.Handler@321213568 (0x13255480) | mHasCurrentPermissionsRequest = false | mIdent = 2570698 | mInstanceTracker = android.os.StrictMode$InstanceTracker@321213600 (0x132554a0) | mInstrumentation = android.app.Instrumentation@318994232 (0x13037738) | mIntent = android.content.Intent@321213616 (0x132554b0) | mIsFullFlag = false | mLastAutofillId = 1073741823 | mLastNonConfigurationInstances = null | mMainThread = android.app.ActivityThread@317718816 (0x12f00120) | mManagedCursors = java.util.ArrayList@321213688 (0x132554f8) | mManagedDialogs = null | mMenuInflater = null | mParent = null | mReferrer = "com.dankegongyu.employee" | mResultCode = 0 | mResultData = null | mResumed = false | mSearchEvent = null | mSearchManager = null | mStartedActivity = false | mStopped = true | mTaskDescription = android.app.ActivityManager$TaskDescription@321213752 (0x13255538) | mTemporaryPause = false | mTitle = "收房工单" | mTitleColor = 0 | mTitleReady = true | mToken = android.os.BinderProxy@321213816 (0x13255578) | mTranslucentCallback = null | mUiThread = java.lang.Thread@1939076448 (0x7393f560) | mVisibleBehind = false | mVisibleFromClient = true | mVisibleFromServer = true | mVoiceInteractor = null | mWindow = com.android.internal.policy.HwPhoneWindow@321213848 (0x13255598) | mWindowAdded = true | mWindowManager = android.view.WindowManagerImpl@321214256 (0x13255730) | mInflater = com.android.internal.policy.HwPhoneLayoutInflater@321214288 (0x13255750) | mOverrideConfiguration = null | mResources = android.content.res.HwResources@321214336 (0x13255780) | mTheme = android.content.res.Resources$Theme@321214384 (0x132557b0) | mThemeResource = 2131755015 | mBase = android.app.ContextImpl@321214400 (0x132557c0) | shadow$klass = com.dankegongyu.salein.business.change.ContractChangeActivity | shadow$monitor = 1320269642
-
Excluded Refs: | Field: android.os.Message.obj | Field: android.os.Message.next | Field: android.os.Message.target | Field: android.view.inputmethod.InputMethodManager.mNextServedView | Field: android.view.inputmethod.InputMethodManager.mServedView | Field: android.view.inputmethod.InputMethodManager.mServedInputConnection | Field: android.view.inputmethod.InputMethodManager.mCurRootView | Field: android.view.inputmethod.InputMethodManager.mLastSrvView | Field: android.accounts.AccountManager$AmsTask$Response.this$1 | Field: android.view.accessibility.AccessibilityNodeInfo.mOriginalText | Field: com.android.internal.policy.BackdropFrameRenderer.mDecorView | Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always) | Thread:FinalizerWatchdogDaemon (always) | Thread:main (always) | Thread:LeakCanary-Heap-Dump (always) | Class:java.lang.ref.WeakReference (always) | Class:java.lang.ref.SoftReference (always) | Class:java.lang.ref.PhantomReference (always) | Class:java.lang.ref.Finalizer (always) | Class:java.lang.ref.FinalizerReference (always)
麻烦提供详细信息
这个是对应的界面 @Route(path = SiRouterConstants.Common.PATH_CONTRACT_CHANGE) public class ContractChangeActivity extends DKBaseFlutterPageActivity {
@Override
public String getContainerName() {
return FlutterSaleIn.PREFIX + SiRouterConstants.Common.PATH_CONTRACT_CHANGE;
}
@Override
public Map getContainerParams() {
return null;
}
}
麻烦提供详细信息
父类中只在onCreate中处理了状态栏,其他都没做
麻烦提供详细信息
返回按的是手机物理返回键,经过测试使用FlutterBoost.singleton.closePageForContext(context);相关的三种关闭界面方法,在首次进入关闭界面都会出现内存泄露
2019-04-26 10:42:22.088037+0800 GundamSales[27543:7125010] Possibly Memory Leak. In case that FLBFlutterViewControllerAdaptor should not be dealloced, override -willDealloc in FLBFlutterViewControllerAdaptor by returning NO. View-ViewController stack: ( DKFlutterBaseViewController, FLBFlutterViewControllerAdaptor ) 2019-04-26 10:42:22.101463+0800 GundamSales[27543:7125010] Memory Leak: ( DKFlutterBaseViewController, UIView, FlutterView )
进入继承BoostFlutterActivity的Activity,返回 报内存泄露。

没人管内存泄露的问题吗
根Activity是不会被释放的,Flutter目前还有一些内存问题,期待谷歌后续的版本。