memory泄露分析方法(Binder,Window,View篇)

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种泄漏原因:

  1. Death Recipients泄露

  2. 对端注册了太多的callback导致泄漏

  • LocalBinders:本地创建的bindercallback对象,传给Server对端回调我用(LocalBinders数量,有多少个人可联系上)

Android BinderProxy leak 原理分析-CSDN博客

相关推荐
mygljx9 小时前
MySQL 数据库连接池爆满问题排查与解决
android·数据库·mysql
xinhuanjieyi10 小时前
ruoyimate导入sql\antflow\bpm_init_db.sql报错
android·数据库·sql
闲猫11 小时前
基于RABC的权限控制设计
android
星霜笔记14 小时前
GitMob — 手机端 GitHub 管理工具
android·kotlin·github·android jetpack
LiuYaoheng14 小时前
问题记录:Android Studio Low memory
android·ide·android studio
独隅15 小时前
Python 标准库 (Standard Library) 全面使用指南
android·开发语言·python
always_TT15 小时前
strlen、strcpy、strcat等常用字符串函数
android
qqty121716 小时前
MySQL Workbench菜单汉化为中文
android·数据库·mysql
2401_8955213416 小时前
MySQL中between and的基本用法
android·数据库·mysql
云云鬼才16 小时前
CoCo编辑器、图形化编程怎么调用Scheme(跳转应用)
android