当前位置:网站首页>Analysis of camera memory memory leakage (II)
Analysis of camera memory memory leakage (II)
2022-06-26 03:46:00 【Cmatrix204】
adopt Provider Yes com.android.camera2 Conduct memory Monitoring is only equivalent to monitoring a process memory info Information monitoring , When a real memory leak occurs , A separate check camera.android.camera2 A single package is certainly not complete check Problem point , Can pass sysinfo The corresponding /proc/meminfo In the message MemAvailable The displayed size is used to view the macro usage , Then the process of doubt is passed dumpsys meminfo The way to check Specific skeptical processes , Now in order to Camera Module as an example .
One 、sysinfo The information determines the problem time node
Every time 2min Printing system meminfo Of sysinfo log, Before and after the time node when the relevant problem occurs, you can go through sysinfo The approximate time point of meminfo Is there a problem with the status of .
Specific tracking log as follows :
Let's see if there is crash And so on camera Crumble log produce

analysis sysinfo dependent memAvailable, Every time 2min Within 200M Left and right memory Information fluctuation , In a 2min Within the band of 800M Memory fluctuations , The abnormal occurrence here will lead to camera crash And other related information to release the occupied memory, resulting in large memory fluctuations .

22:52:25-22:54:26 Analyze other main log Corresponding node discovery com.android.camera OOM abnormal ( It's like reporting an error :lowmemory) Error message .
Two 、 adopt dumpsys meminfo Memory occupation of pressure measurement and positioning related processes
Yes camera Related to each process memory Monitor and handle the usage . 1.
1. Through the command dump camera Application layer related memory
adb shell "dumpsys meminfo com.android.camera2 | awk '/Graphics|Java Heap:|Native Heap:|TOTAL PSS/' " >>meminfo.txt

2. Through the command dump camera HAL/FrameWork Layer dependent memory Information
adb shell ps -A | grep camera

see camera HAL Related memory information
adb shell "dumpsys meminfo 504" >> meminfo_cameraprovider.txt

see camera FrameWork Layer related memory information
adb shell "dumpsys meminfo 726" >> meminfo_cameraserver.txt
Finally, for each test memory Total Pss Information for statistics , Draw as a related process and take continuous photos memory Relevant charts can be used to visually observe the relevant memory consumption , The view is as follows :


Exhibition information platform Camera The related process

MTK platform Camera The related process 
summary
Memory related exceptions are certainly not as easy to handle as other problems , Repeated pressure test is required , Identify specific outliers , Even need to borrow addr2line -e -f Parse dynamic link library , Locate the function interface corresponding to the stack address when the exception occurs ;objdump -S -D Disassembly related lib, Identify specific problem points ; Finally, if you can locate a specific memory application point , It will be much better to solve it .
边栏推荐
- Tupu software is the digital twin of offshore wind power, striving to be the first
- MySQL advanced Chapter 1 (installing MySQL under Linux) [2]
- HL7Exception: Can‘t XML-encode a GenericMessage. Message must have a recognized struct
- Class diagram
- mysql存储过程
- Classic model alexnet
- 2022.6.25-----leetcode.剑指offer.091
- Camera-memory内存泄漏分析(三)
- The kotlin project is running normally and the R file cannot be found
- Oracle技术分享 oracle 19.14升级19.15
猜你喜欢

Kotlin uses viewpager2+fragment+bottomnavigationview to implement the style of the switching module of the bottom menu bar.

Todolist incomplete, completed

String到底能不能改变?

ASP. Net startup and running mechanism

Uni app Baidu cloud realizes OCR ID card recognition

XGBoost, lightGBM, CatBoost——尝试站在巨人的肩膀上

MySQL高级部分( 四: 锁机制、SQL优化 )

DETR3D 多2d图片3D检测框架

MapReduce执行原理记录

机器学习笔记 - 时间序列的趋势分量
随机推荐
xml 解析bean工具类
Solve the problem that the input box is blocked by the pop-up keyboard under the WebView transparent status bar
Sqlitestudio download address
Uni app custom selection date 2 (September 16, 2021)
Do you want to add a key to the applet or for sequence?
等保备案是等保测评吗?两者是什么关系?
Classic model alexnet
ABP framework Practice Series (III) - domain layer in depth
Nebula Graph学习篇3_多线程完成6000w+关系数据迁移
Is it safe for individuals to buy stocks with flush software? How to buy stocks
Cloud Computing Foundation -0
虚拟化是什么意思?包含哪些技术?与私有云有什么区别?
Is the compass app regular? Is it safe or not
MySQL高级部分( 四: 锁机制、SQL优化 )
Digital twin intelligent water service, breaking through the development dilemma of sponge City
2020 summary: industrial software development under Internet thinking
Slide the menu of uni app custom components left and right and click switch to select and display in the middle
169. 多数元素
js实现文字跑马灯效果
机器学习笔记 - 时间序列的趋势分量