mediaserver内存泄露分析

Android 内存查询命令


top命令
PID PR CPU% S  #THR     VSS     RSS PCY UID      Name
VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)
RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存)
PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
USS- Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)
一般来说内存占用大小有如下规律:VSS >= RSS >= PSS >= USS

dumpsys meminfo命令
主要用于App
TOTAL:   104523      TOTAL SWAP (KB):      756




cat /proc/$media_pid/maps总体的内存分布
cat /proc/$media_pid/smaps内存分布的细节

问题mediaserver,再不断录影时候内存会增加,每次VSS增加4M左右,每次RSS增加38k左右


maps比较如下:



smaps比较如下:



最终原因

startpreview中重复调用这句

mGsensorInitThread.launch(gsensorInitRoutine,this);

stoppreview中没有释放

总结

pthread_create在launch时不断地申请内存,而不是内存。

详见:http://blog.csdn.net/yetyongjin/article/details/7673837

proc/pid/maps分析,首先要考虑进程中栈与堆之间的布局关系,即栈与堆相邻。


发布了37 篇原创文章 · 获赞 26 · 访问量 5万+
展开阅读全文

ICamera died,MediaMetadataRetriever server died!

10-19

使用视频录像功能报错,请大神们帮忙看一下 10-19 11:44:10.875: V/Camera-JNI(24054): get_native_camera: context=0x744aaeb0, camera=0x40ddbc38 10-19 11:44:10.895: I/MediaRecorderJNI(24054): prepare: surface=0x742b8a18 (identity=156) 10-19 11:44:11.515: W/Camera(24054): ICamera died 10-19 11:44:11.515: W/MediaMetadataRetriever(24054): MediaMetadataRetriever server died! 10-19 11:44:11.515: V/Camera-JNI(24054): notify 10-19 11:44:11.515: W/Camera(24054): Camera server died! 10-19 11:44:11.515: W/IMediaDeathNotifier(24054): media server died 10-19 11:44:11.515: E/Camera(24054): Error 100 10-19 11:44:13.077: V/Camera-JNI(24054): setHasPreviewCallback: installed:0, manualBuffer:0 10-19 11:44:13.077: V/Camera-JNI(24054): get_native_camera: context=0x744aaeb0, camera=0x40ddbc38 10-19 11:44:13.077: V/Camera-JNI(24054): Clearing callback buffers, 0 remained 10-19 11:44:13.077: V/Camera-JNI(24054): stopPreview 10-19 11:44:13.077: V/Camera-JNI(24054): get_native_camera: context=0x744aaeb0, camera=0x40ddbc38 10-19 11:44:13.077: V/Camera-JNI(24054): lock 10-19 11:44:13.077: V/Camera-JNI(24054): get_native_camera: context=0x744aaeb0, camera=0x40ddbc38 10-19 11:44:13.077: V/Camera-JNI(24054): release camera 10-19 11:44:13.077: V/Camera-JNI(24054): release 10-19 11:44:13.077: V/Camera-JNI(24054): Clearing callback buffers, 0 remained 10-19 11:44:13.077: V/Camera-JNI(24054): Clearing callback buffers, 0 remained 10-19 11:44:13.077: V/Camera-JNI(24054): native_release: context=0x744aaeb0 camera=0x40ddbc38 10-19 11:44:13.077: V/Camera-JNI(24054): release 10-19 11:44:13.077: V/Camera-JNI(24054): Clearing callback buffers, 0 remained 10-19 11:44:13.077: V/Camera-JNI(24054): Clearing callback buffers, 0 remained 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览