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.

C6A816x Integra EVM: C6runApp malloc() is resulting into "out of memory" error.

Other Parts Discussed in Thread: SYSBIOS

Hi,

    I have a very simple C code (Check at the end of this post!)

My intention to write this code was to see how I can build executables for ARM and DSP using C6RunApp tool, I learnt how to do that and the tool generated <ProjectName>_arm and <ProjectName>_dsp executables. I copied the executables to the SDCARD (with Linux) to /usr/bin and I ran both the applications from my remote terminal. With that I see, the <ProjectName>_arm works correctly. But <ProjectName>_dsp gives the following error:

ti.sysbios.heaps.HeapMem: line 296: out of memory: handle=0x996b9de0, size= 40140808

What's going wrong here? I was under the impression that when we call malloc, the memory is allocated in heap memory and if there is enough memory to be allocated when we run ARM version, then why fail to allocate it for DSP version?

Help!

-----------Code---------

#include <stdio.h>

#include <stdlib.h>

int main()

{

short *ptr = NULL;

ptr = (short *) malloc(sizeof(short) * 20070404);

if(ptr == NULL)

{

printf("\nMalloc did NOT succeed\n");

}

else

{

printf("\nMalloc succeeded\n");

}

return 0;

}