当前位置:网站首页>Camera-memory内存泄漏分析(三)
Camera-memory内存泄漏分析(三)
2022-06-26 03:19:00 【Cmatrix204】
通过Provider、sysinfo监控查看内存泄漏的机制会有一些利弊,并不能很准确的反应出相对应的memory的变化,更愿意选择通过dumpsys meminfo去check具体进程的memory变化情况,而且dumsys信息也会更全面、更利于整体把控相关问题点。
一、Profiler VS dumpsys
dumpsys memory拿到的信息量以及可监控的进程量是远远多于Profiler,有的问题可以通过dumpsys发现,有的问题通过Profiler就可能是误判。
Profiler实时监控的memory情况:
dumpsys监控下的memory情况:
二、 dumpsys meminfo正常、异常数据对比
正常数据:
异常数据:
三、展讯平台malloc异常追踪
不同的平台都有一定的对malloc申请与释放追踪的机制,以下以展锐平台为例,配置好追踪malloc的backtrace之后,在复现内存泄漏的设备下dump native heap信息,用平台development里面相关的脚本进行解析即可得到以下堆积malloc堆栈的lib信息。
总结
其实Android内存相关的问题并不仅仅是内存泄露的问题,在项目中还曾经遇到过动态申请的堆空间异常导致程序用到这一堆栈时出现崩溃的问题,之前同一个项目中俩个不同的算法同时遇到了类似的问题,这个问题最后虽然用提前申请malloc空间的方案解决了,但是作为研发,感觉真的有必要更深层次的研究这些问题背后到底发生了什么,不过这个问题的研究可能会被delay。
边栏推荐
- MySQL addition, deletion, query and modification (primary level)
- Qixia fire department carries out fire safety training on construction site
- 类图
- Analysis on the diversification of maker space mechanism construction
- Partition, column, list
- 数字孪生智慧水务,突破海绵城市发展困境
- 【读点论文】FBNetV3: Joint Architecture-Recipe Search using Predictor Pretraining 网络结构和超参数全当训练参数给训练了
- 校园创客空间的硬件造物原理
- Is it safe for Caicai securities to open an account in 2022?
- Double carbon bonus + great year of infrastructure construction 𞓜 deep ploughing into the field of green intelligent equipment for water conservancy and hydropower
猜你喜欢
Group counting notes - instruction pipeline of CPU
解析少儿编程的多元评价体系
Todolist incomplete, completed
Uni app custom drop-down selection list
Double carbon bonus + great year of infrastructure construction 𞓜 deep ploughing into the field of green intelligent equipment for water conservancy and hydropower
Hardware creation principle of campus maker space
解决uniapp插件robin-editor设置字体颜色和背景颜色报错的问题
Run multiple main functions in the clion project
kotlin快速上手
上传文件/文本/图片,盒子阴影
随机推荐
图扑软件数字孪生海上风电 | 向海图强,奋楫争先
View of MySQL
等保备案是等保测评吗?两者是什么关系?
Communication mode between processes
Is it safe for individuals to buy stocks with flush software? How to buy stocks
Graphics card, GPU, CPU, CUDA, video memory, rtx/gtx and viewing mode
Kotlin quick start
项目部署遇到的问题-生产环境
Run multiple main functions in the clion project
进程之间的通信方式
Multimedia elements, audio, video
Is the compass app regular? Is it safe or not
[hash table] improved, zipper hash structure - directly use two indexes to search, instead of hashing and% every time
2022年挖财证券开户安全嘛?
Is Guoxin golden sun reliable? Is it safe to open a securities account?
MySQL增删查改(初阶)
Question about SQL: SQL question -- SQL code for multiple account logins
Xgboost, lightgbm, catboost -- try to stand on the shoulders of giants
jupyter notebook的插件安装以及快捷键
Worm copy construction operator overload