在运行DM365 DVSDK中例程或者借用DVSDK运行自己的程序的时候,运行可执行文件时候可能会遇到这种问题
终端错误如下:
CMEMK Error: Failed to find a pool which fits 622080
CMEM Error: getPool: Failed to get a pool fitting a size 622080Aborted
显示的是内存空间不够
此时,最先考虑的是自己程序有没有内存泄露,或者是否循环运行了buffer申请的代码等,
如果都没有就可能真的是内存不够了,可以参考如下的解决办法:注意要排除非自己程序因素后才用此种方法,因为不然的话治标不治本
以下内容参考自:http://blog.csdn.net/talent258/article/details/5725720 但是我按照一下方法试了下减小系统内存扩大用户内存,但是在执行DVSDK encode例程时显示的是capture线程无法创建,不知为何
按照上面的方法,进行jpgdec的演示:
root@SEED_DVS365# ./jpgdec-r
出错,如下:
CMEMK Error: Failed to find a pool which fits 3686400 CMEM Error: getPCMEMK Error: Failed to find a pool which fits 3686400 ool: Failed to get a pool fitting a size 3686400 CMEM Error: getPool: Failed to get a pool fitting a size 3686400 Segmentation fault |
是内存方面出错,貌似没有大小为3686400的连续内存块,查看loadmodule.sh
==========================================================
# Pools configuration
insmod cmemk.ko phys_start=0x85000000 phys_end=0x88000000 pools=6x4096,2x8192,1x11908,2x13184,1x2697152,6x4096,1x30720,3x81920,1x3185664,64x56,1x320,1x640,1x81920,1x6650880,2x608,1x296,1x28,2x24,23x1548288,1x154288 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672
==========================================================
现在的内存是128M的,其中uBoot配置Linux启动参数时,分配给Linux的内存为80M,
则剩下为48M,从0x85000000到0x88000000,刚好是48M
所以我认为:Linux操作系统占了80M,给应用程序的内存只有48M
再看目前的pool,加起来已经有48,766,952,即剩余1,564,696,不够3,686,400
所以不能在后面直接添加“1x3686400”
需要重新配置Linux的内存大小,重新设置uBoot中的启动参数:
setenv bootargs mem=64M console=ttyS0,115200n8 noinitrd rw ip=192.168.1.144:255.255.255.0:192.168.1.254 root=/dev/mtdblock3 rootfstype=yaffs video=davincifb:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4
saveenv
boot
(以上操作可参考:http://blog.csdn.net/talent258/archive/2010/06/28/5699971.aspx)
然后再修改loadmodule.sh,如下:
==========================================================
# Pools configuration
insmod cmemk.ko phys_start=0x84000000 phys_end=0x88000000 pools=6x4096,2x8192,1x11908,2x13184,1x2697152,6x4096,1x30720,3x81920,1x3185664,64x56,1x320,1x640,1x81920,1x6650880,2x608,1x296,1x28,2x24,23x1548288,1x154288,1x3686400 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672
==========================================================
通过tftp把它下载下去,重新运行:
root@SEED_DVS365# ./loadmodule.sh
root@SEED_DVS365# ./jpgdec-r
还是出现错误,如下:
==========================================================
CMEMK Error: Failed to find a pool which fits 3686400
CMEM Error: getPool: Failed to get a pool fitting a size 3686400
Segmentation fault
==========================================================
和之前的错误相比,好像少了一点了。。。
试着分配2块3686400的pool,(把“1x3686400”改为“2x3686400”)
重新下载下去
然后运行
。。。
这个问题算是解决了。