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.

Can sysbios HeapMultiBuf can reslove heap fragmentation problem in my app?

Other Parts Discussed in Thread: TMS320C6678

Hi,all:

I found my app would crash after run for a short time.When I debug,I found CCS console

hint me that BIOS heap out of memory .

But I promise that I do call free after every malloc in my app. So I wonder if it is because of heap 

fragmentation problem.

I see the user guide of BIOS 6. and see HeapMem HeapMultiBuf and HeapBuf.

what's the advantages of HeapMultiBuf vs HeapMem ? 

Can HeapMultiBuf can reslove  heap fragmentation problem in my app?

Thanks!

  • Hi Ferdinand,

    Moved this thread to correct(TI-RTOS) forum.

    Thanks!

  • Hi Ferdinand,

    Which version of BIOS 6 are you using?  Which hardware platform?

    You may be running into a fragmentation problem.  Have you tried using the ROV tool (in CCS, in the debug view, select tools -> ROV).

    Once ROV is open, you can view your HeapMem.  The HeapMem view has a free list.  This will give you a visual display of the heap, showing you blocks allocated and blocks free.  It could be that you have many free blocks that are of small size (i.e. fragmentation).  You should try ROV when the problem occurs in your app.

    HeapMultiBuf may help you with fragmentation, or even HeapBuf.  Please refer to the BIOS User's Guide, section "6.8 Heap Implementations" for details.

    Steve


  • Hi,Steve:

    My bios version is bios_6_35_04_50 and my platform is tms320c6678.

    Thanks for your reply. I know ROV and I also try to use ROV to check where memory leak

    take place.But I have gained nothing. So I guess that is out of fragmentation problem.

    How do you know that HeapMultiBuf or HeapBuf may play a part with fragmentation

    problem other than HeapMem? I am not sure.

  • Hi Ferdinand,

    Ferdinand said:
    So I guess that is out of fragmentation problem.

    Did you look at the free list in ROV for HeapMem?  This will help you determine if your heap is fragmented or not.

    Again, if you see that you have a lot of total free space, but that free space consists of many small blocks of available memory, then you have a fragmented heap.  If your total available memory in the heap is larger than the size you are trying to allocate, but none of the free blocks (shown in the free list) are large enough to satisfy that allocation, then your allocation is failing due to fragmentation.

    Ferdinand said:
    How do you know that HeapMultiBuf or HeapBuf may play a part with fragmentation

    problem other than HeapMem?

    Were you able to read BIOS User's Guide, section "6.8 Heap Implementations"?  This explains differences between those different heaps.

    Steve