在VIO-->编解码 --》推流过程中。出现了内存泄露导致后面申请不到内存,导致初始化失败
现象:
1.1在做一路,摄像头编解码的过程中,出现了内存泄露问题
1.2解决问题的思路
在相应的位置添加对应的log
在vio init启动的时候,
查看占用了多少内存
在vio delete
查看释放了多少内存
统计得到两者的释放和占用的比列:
vio init...
[ 28.752138] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=3, alloc_size_total=32501760, size=5529600
[ 28.753826] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=4, alloc_size_total=38031360, size=5529600
[ 28.755379] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=5, alloc_size_total=43560960, size=5529600
[ 28.756972] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=6, alloc_size_total=49090560, size=5529600
[ 28.758535] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=7, alloc_size_total=54620160, size=5529600
[ 28.760117] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=8, alloc_size_total=60149760, size=5529600
[ 28.869351] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=9, alloc_size_total=62021632, size=1871872
[ 28.870834] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=10, alloc_size_total=63893504, size=1871872
[ 28.872360] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=11, alloc_size_total=65765376, size=1871872
[ 28.873826] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=12, alloc_size_total=67637248, size=1871872
[ 28.875293] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=13, alloc_size_total=69509120, size=1871872
[ 28.876817] ion_carveout_allocate: zing test: alloc buffer from pool: alloc_count=14, alloc_size_total=71380992, size=1871872
codec deinit ...
vio deinit ...
vio deinit ...
[ 38.268368] ion_carveout_free: zing test: free buffer from pool: free_count=1,free_size_total=5529600, [ no_free_size_total=140697600 ]
[ 38.270485] ion_carveout_free: zing test: free buffer from pool: free_count=2,free_size_total=11059200, [ no_free_size_total=135168000 ]
[ 38.272641] ion_carveout_free: zing test: free buffer from pool: free_count=3,free_size_total=16588800, [ no_free_size_total=129638400 ]
[ 38.274761] ion_carveout_free: zing test: free buffer from pool: free_count=4,free_size_total=22118400, [ no_free_size_total=124108800 ]
[ 38.276888] ion_carveout_free: zing test: free buffer from pool: free_count=5,free_size_total=27648000, [ no_free_size_total=118579200 ]
[ 38.278986] ion_carveout_free: zing test: free buffer from pool: free_count=6,free_size_total=33177600, [ no_free_size_total=113049600 ]
解决方法:分段解决
1.单独使用VIO进行处理 -------------没有发生内存泄露
2. 和标准的相对,--------------------- 做了初始化,没有做相关的释放工作