基本数据结构:
// 用于描述内核缓冲区的结构体,Binder 通信的基本缓冲单元
struct binder_buffer *buffer;
#Binder导致crash# kill crash原因分析-优快云博客
#Binder风暴导致binder失败#
E IPCThreadState: Process seems to be sending too many oneway calls.
E JavaBinder: !!! FAILED BINDER TRANSACTION !!!
(当前进程发送的oneway binder调用太多,binder线程快不够用了,紧接着马上要binder fail了) 源码如下:defaultServiceManager介绍-腾讯云开发者社区-腾讯云
关键字:JavaBinder
#binder线程数量判断#
“binder thread pool”搜索:
E IPCThreadState: binder thread pool (15 threads) starved for (appbinder线程被用光,
E IPCThreadState: binder thread pool (31 threads) starved for 108 ms (SystemServer binder线程被用光,等待了108ms "Waiting for thread to be free"
统计Binder线程数量方法:
- adb shell debuggerd -b pid //统计binder开头的
- trace:binder开头的线程数量(perfetto和simpleperf,profiler都可实现)
#binder 泄露#
LocalBinders | 本地创建的bindercallback对象,传给Server对端回调我用的 表示我向外发了多少张名片 复现场景:新建callback(binder对象)给对端 |
Proxy Binders | 本地持有Server的remote binder对象:(向外发1次binder请求,新建1个Proxy Binders对象)表示我有多少人联系方式
|
Death Recipients | 从dump meminfo结果发现Death Recipients对象超过1000个,从业务代码没有找到Death Recipients注册,从RemoteCallbackList源码发现默认注册了Death Recipients,原因是每次传过来1个aidlCallback都要new一个RemoteCallbackList来保存 |