内存泄漏还是速度慢的模拟器?

问题描述 投票:0回答:1

我在配置项上遇到下一个错误:

531532 bytes retained by leaking objects
Signature: 57cc9bd9b14a813ead44f7eba2d9ffa1de2c4649
┬───
│ GC Root: Java local variable
│
├─ android.app.Instrumentation$InstrumentationThread thread
│    Leaking: UNKNOWN
│    Thread name: 'Instr: com.comp.test.runner.YInstrumentationRunner'
│    ↓ Instrumentation$InstrumentationThread.<Java Local>
│                                            ~~~~~~~~~~~~
├─ java.util.ArrayList instance
│    Leaking: UNKNOWN
│    ↓ ArrayList.elementData
│                ~~~~~~~~~~~
├─ java.lang.Object[] array
│    Leaking: UNKNOWN
│    ↓ Object[].[0]
│               ~~~
├─ org.junit.runner.Result$Listener instance
│    Leaking: UNKNOWN
│    ↓ Result$Listener.this$0
│                      ~~~~~~
├─ org.junit.runner.Result instance
│    Leaking: UNKNOWN
│    ↓ Result.failures
│             ~~~~~~~~
├─ java.util.concurrent.CopyOnWriteArrayList instance
│    Leaking: UNKNOWN
│    ↓ CopyOnWriteArrayList.elements
│                           ~~~~~~~~
├─ java.lang.Object[] array
│    Leaking: UNKNOWN
│    ↓ Object[].[4]
│               ~~~
├─ org.junit.runner.notification.Failure instance
│    Leaking: UNKNOWN
│    ↓ Failure.fThrownException
│              ~~~~~~~~~~~~~~~~
├─ androidx.test.espresso.NoMatchingViewException instance
│    Leaking: UNKNOWN
│    ↓ NoMatchingViewException.rootView
│                              ~~~~~~~~
├─ com.android.internal.policy.DecorView instance
│    Leaking: YES (View.mContext references a destroyed activity)
│    mContext instance of com.android.internal.policy.DecorContext, wrapping activity com.comp.android.t.ui.TransactionAggregateActivity with mDestroyed = true
│    View#mParent is null
│    View#mAttachInfo is null (view detached)
│    View.mWindowAttachCount = 1
│    ↓ DecorView.mContentRoot
├─ android.widget.LinearLayout instance
│    Leaking: YES (DecorView↑ is leaking and View.mContext references a destroyed activity)
│    mContext instance of com.comp.android.t.ui.TransactionAggregateActivity with mDestroyed = true
│    View#mParent is set
│    View#mAttachInfo is null (view detached)
│    View.mWindowAttachCount = 1
│    ↓ LinearLayout.mContext
╰→ com.comp.android.t.ui.TransactionAggregateActivity instance
​     Leaking: YES (ObjectWatcher was watching this because com.comp.android.t.ui.TransactionAggregateActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)
​     key = 61835653-e97b-48a8-b7a2-8663d45eeec5
​     watchDurationMillis = 8798
​     retainedDurationMillis = 3797
android android-emulator leakcanary
1个回答
0
投票

[当JUnit在运行时类路径上时,通过将LeakCanary.config.dumpHeap设置为false,将自动禁用LeakCanary。

© www.soinside.com 2019 - 2024. All rights reserved.