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 pool calculation



Hello,

I actually try to calculate the sizes of my CMEM pools needed for H264 and MJPEG encoder. I went through the documentation and added all buffers listed there. I'm creating the codecs using the codec_engine.

Now if I create the codecs I see a lot of other additional cmem allocations allocating only a few bytes (56, 24,..).

Where do this allocs come from and where can I find  a documentation for them?

 

Best regards

 

Frank

  • CE_DEBUG is probably your friend and should show what is leading to those allocations:

    http://processors.wiki.ti.com/index.php/CE_DEBUG

    If you're on a DM365, or are creating Linux-side codecs, the memory those codecs require (requested during creation of the codec and freed during deletion) also comes from CMEM.  This is b/c the accelerators the codecs use (DMA and otherwise) require physically contiguous memory.

    We're way overdue for a wiki article on good techniques to calculate your CMEM usage.  :(  It typically involves _initially_ giving no memory for pools (so it's all heap-allocated - easy to use, but subject to fragmentation), running your app, and recording the memory usage.  Then, when the initial dev is stable, you've figured out the right create params for the codecs, etc, and you know what the CMEM usage will be, you _then_ switch to pool-based allocation (which isn't subject to fragmentation and allocs will therefore never fail), and finally you optimize the memory map to reduce CMEM usage as much as possible.

    Chris