View泄露:从Hprof找大量重复的view,点击查看text文案如果相同则找产品他们确认是否合理 window泄露:代码或dumpsys window来监测是否有大量同名window,不能用windowtoken来辨别是否重复window,每个window token都不一样,windowtoken初始化过程如下所示:
ViewRootImpl(
mWindow = new W(this);
mAttachInfo = new View.AttachInfo(mWindowSession, mWindow, display, this, mHandler, this,context);
mWindowToken = window.asBinder();
Binder泄露:
Too many Binders sent to SYSTEM
2类泄漏:
-
ProxyBinders:本地持有对端remote binder对象:(向外发1次binder请求,新建1个Proxy Binders对象) 我有多少联系人
2种报错形式
- Debuggable builds will throw an AssertionError if the number of map entries exceeds 25_000
Binder ProxyMap has too many entries: 20691 (total), 20691 (uncleared), 20691 (uncleared after GC ). BinderProxy leak?
-
Android系统创建的Binder数量最大值超过6000,非systemuid的binder调用会被kill掉
2种泄漏原因:
-
Death Recipients泄露
-
对端注册了太多的callback导致泄漏
-
LocalBinders:本地创建的bindercallback对象,传给Server对端回调我用(LocalBinders数量,有多少个人可联系上)
Android BinderProxy leak 原理分析-CSDN博客