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.

Heap memory Assertion failure!

Other Parts Discussed in Thread: SYSBIOS

Hi all,

I'm currently doing a project modifying the MCSDK Image processing demo. 
I have to upload a file of size more than 100MB.

Allocated RxBuffer=Memory_alloc(0, ContentLength, 8, NULL);

after uploading the file and receiving it we allocated

TximgBuffer=Memory_alloc(0, ContentLength, 8, NULL);

At this point the execution terminates and the following error is displayed in the console:

 

[C66xx_0] ti.sysbios.heaps.HeapMem: line 331: assertion failure: A_invalidFree: Invalid free

[C66xx_0] xdc.runtime.Error.raise: terminating execution

 

After processing the data in the RxBuffer I have to copy it into TxImgBuffer. So to increase the Memory capabilites what changes should I be making? Should I be increasing heap size in the .cfg file? Or what else Should I be doing?


Regards,
Sohal 

 

  • Hello Sohal,

     

    I guess you are already increasing the heap size, as per the suggestion in the post below :

     

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/149923.aspx#548173

     

    If you are using the C6678l EVM, the total DDR size is 256M. 

     

    Also have you tried freeing any intermediate buffer that you are finished using, using Memory_free() ?

     

    Let us know. Hope this helps.

  • Dear Bellary,
    Thanks for the quick reply. The DDR you are refferring to is DDR3?  But the EVM is having 4GB external memory right? I have tried increasing the heap memory by changing the heap size values but still the it gets terminated when a secondary buffer is allocated in memory. I'm using the same function serve_result_page where it checks 

    if (gTxImgBuffer_size) {

            Memory_free(0, gTxImgBuffer, gTxImgBuffer_size);

            gTxImgBuffer_size = 0;

        }

     

        if (gRxBuffer_size) {

            Memory_free(0, gRxBuffer, gRxBuffer_size);

            gRxBuffer_size = 0;

        }

     

    My requirement is to upload a big file to a buffer.... do some processing on that buffer.... copy it to another buffer.... do some other processing on this bufer and output the input and processed buffers. 
    My issue is i'm not able to allocate the second buffer. 


    Regards,
    Sohal 

  • Hello Sohal,

     

    I was refering to DDR3. And let me correct myself : there is 512MB on the EVMs, not 256MB as previously mentioned.

     

    Yes - with 32 address bits, 4GB of memory is addressable. In the C667x architecture, external memory is mapped from 0x8000:0000 - 0xffff:ffff. Which is total of 2GB. 

    Are you using the EVM - C6678l ? If so - on the EVM however, there is only 512MB of external memory on the board.

    This 512 MB is mapped 0x8000:0000 - 0x9fff:ffff

     

    Beyond this range if you address the memory, then it wraps around. 

    For example : If you access 0xa000:0200 => then this access wraps around to 0x8000:0200.

    So when you access memory beyond 512MB, it will may/may not generate error, but certainly you may see unpredictable system behaviour.

     

    One more suggestion is to first get this working with smaller buffers and then scale up to 100MB buffer. However I feel 512MB DDR3 capacity is enough to suffice your needs.

    Hope this helps. Keep us posted.