友盟推送引发的内存泄漏:UmengMessageCallbackHandlerService
2022-02-15 10:31:35.113 9927-10221/com.eoffcn.questions D/LeakCanary:
====================================
HEAP ANALYSIS RESULT
====================================
1 APPLICATION LEAKS
References underlined with "~~~" are likely causes.
Learn more at https://squ.re/leaks.
1416 bytes retained by leaking objects
Signature: 99e784c1433b5477fe40e3ebca5ffce0e9dd16
┬───
│ GC Root: System class
│
├─ android.content.res.ResourcesImpl class
│ Leaking: NO (a class is never leaking)
│ ↓ static ResourcesImpl.mAppContext
│ ~~~~~~~~~~~
├─ android.app.ContextImpl instance
│ Leaking: UNKNOWN
│ Retaining 2.7 kB in 22 objects
│ mOuterContext instance of com.umeng.message.UmengMessageCallbackHandlerService
│ ContextImpl.mOuterContext is an instance of com.umeng.message.UmengMessageCallbackHandlerService
│ ↓ ContextImpl.mOuterContext
│ ~~~~~~~~~~~~~
╰→ com.umeng.message.UmengMessageCallbackHandlerService instance
Leaking: YES (ObjectWatcher was watching this because com.umeng.message.UmengMessageCallbackHandlerService
received Service#onDestroy() callback and Service not held by ActivityThread)
Retaining 1.4 kB in 15 objects
key = 084a9db7-a221-4be6-bf2b-35ff69b1bb48
watchDurationMillis = 7223
retainedDurationMillis = 2185
mApplication instance of com.eoffcn.questions.config.MainApplication
mBase instance of android.app.ContextImpl
====================================
0 LIBRARY LEAKS
A Library Leak is a leak caused by a known bug in 3rd party code that you do not have control over.
See https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/#4-categorizing-leaks
====================================
0 UNREACHABLE OBJECTS
An unreachable object is still in memory but LeakCanary could not find a strong reference path
from GC roots.
====================================
METADATA
Please include this in bug reports and Stack Overflow questions.
Build.VERSION.SDK_INT: 30
Build.MANUFACTURER: Xiaomi
LeakCanary version: 2.7
App process name: com.eoffcn.questions
Count of retained yet cleared: 1 KeyedWeakReference instances
Stats: LruCache[maxSize=3000,hits=3275,misses=72994,hitRate=4%]
RandomAccess[bytes=3700843,reads=72994,travel=40396405269,range=23542092,size=30590992]
Heap dump reason: 1 retained objects, app is not visible
Analysis duration: 7249 ms
Heap dump file path: /storage/emulated/0/Download/leakcanary-com.eoffcn.questions/2022-02-15_10-31-22_260.hprof
Heap dump timestamp: 1644892295091
Heap dump duration: 5534 ms
====================================
2022-02-15 10:31:35.149 9927-9927/com.eoffcn.questions D/LeakCanary: Watching instance of leakcanary.internal.HeapAnalyzerService (leakcanary.internal.HeapAnalyzerService received Service#onDestroy() callback) with key d17be0e7-d8ce-4a2d-9a68-bb26f9814a40
UmengMessageCallbackHandlerService本身是由友盟推送自己调用的,代码也被混淆了,无法准确知道具体的泄露原因
