This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CMEM failed to allocate heap

Hi,
i obtain this CMEM error executing av_server on DM365IPNC.
what could be wrong? it seems to be enough heap memory allocated

CMEMK Error: ioctl: failed to allocate heap buffer of size 0x4c9400
CMEM Error: allocHeap: ioctl CMEM_IOCALLOCHEAP failed: -1

this is the cmem message when i load the module

CMEMK module: built on Jul 23 2010 at 15:45:16
  Reference Linux version 2.6.18
  File /home/software/dvsdk_2_10_01_18/linuxutils_2_24_03/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
allocated heap buffer 0xc5000000 of size 0x4800000
CMEM Range Overlaps Kernel Physical - allowing overlap
CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83800000)
cmemk initialized

Regards
Andrea

 

  • Andrea,

    Although your total heap size is larger than your failed heap allocation size, it's possible that the heap has become fragmented to the point that there is not a contiguous block in the heap large enough for the failed size of 0x4c9400, or maybe it's simply due to having already allocated memory from the heap and there's not enough remaining.

    The only way to track CMEM heap allocations is to view debug prints.  The CMEM user library can print debug info, as well as the CMEM kernel module cmemk.ko. See this for user library debug info: http://processors.wiki.ti.com/index.php/CMEM_Overview#Debugging_Techniques (it mentions "% cat /proc/cmem" but that doesn't print heap info, only pool info).  For kernel module debug info, you need to just rebuild the cmemk.ko module using the command 'make debug' in the ti/sdo/linuxutils/cmem/src/module directory, and progress messages will print to the console (lots of them, unfortunately).  You could also set the CE_DEBUG env var to 2 or 3 to see heap allocation messages coming from Codec Engine (which calls down to CMEM for contiguous requests).

    Once you see all the heap allocations and frees then you may get a clearer picture as to why this allocation is failing.

    Regards,

    - Rob

     

  • your cmem has overlaps with kernel (0x80000000 -> 0x83800000)

    change the start address, make it larger than 0x83800000