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.

NDK version 2.1 using CCS4 with C6472

Other Parts Discussed in Thread: TMS320C6672

Hello,

My name is Binh Vu and I work on DSP team at Sonosite, Inc. Currently, I am running NDK version 2.1 on C6472 with memory heap size setup equal to 0x10000

and everything is working fine. However; when I tried to reduce memory heap size from 0x10000 to 0x8000 I got following errors from console after NDK is running:

 

xdc.runtime.Memory: line 52: out of memory: heap=0x0, size=8200

00000.000 mmBulkAlloc(): could not allocate memory.

00000.000 out of memory: heap=0xbebebebe, size=8200

00000.000 SBNew: Buffer OOM

 

I went to on e2e TI website to research more about this issue but I am not able to find any suggestions regarding to what memory heap size should be used for NDK?

 

Following versions are used for the NDK build:

 

Code Composer Studio version: 4.2.1.00004

 

NDK version 2.1

 

Code Generation tools: TI v7.0.4

 

Inter-processor Communication: 1.21.02.23

 

SYS/BIOS: 6.30.03.46

 

XDAIS: 6.25.01.08

 

XDC tools version: 3.20.07.86

 

Please let me know if anyone has any suggestion or solution for the issue.

 

Thanks,

Binh Vu

  • Binh,

    NDK stack usage is heavily dependent on the number of daemons and tasks opened, therefore it is subject to each system configuration. If you are changing the heap size and is hitting OOM errors then you found the heap size to be used with your particular system. 

    Additional details about the debugging can be found at section 3.4.3.2 of the NDK User's Guide.

    I will also move your post to the DSP/BIOS forum so the experts there may have additional insights.

    Hope this helps,

    Rafael

     

  • Binh,

    SYS/BIOS 6.x also ships with a tool called "ROV".  You can use this tool to get more information about the state of your program, such as Task stack sizes or the amount of stack used.  This tool is great for debugging!

    You can open the tool within CCSv4 under the tools menu (must be in the "debug" view):

    Tools ->ROV

    Steve

  • Hi Steve,

    Thanks for suggestion of using Tool->ROV for debugging this issue. However; I am still look into this issue and will post it again if I resovle it.

    Thanks,

    Binh Vu

  • Hello. I have the same problem with memory error. Did you solve it? I think it is due to wrong BIOS's memory / heap settings.

    P.S. I use TMS320C6672 DSP.

  • Vladimir,

    As Rafael said in the above post, the NDK's heap usage depends on the number of daemons and tasks that are created at runtime.  This will vary from program to program.  If you are running out of memory, you can use the ROV tool (in CCSv4: open the tools menu -> ROV) to see how much heap you have used.  Also, the error message itself tells you the amount of memory that was attempted to be allocated ( e.g. size=8200 in the above post's error message).  It also tells you the available amount (heap=0x0 in the above).

    Furthermore, once you have your program running without the heap allocation error, you can again use ROV to check your task stack peaks.  The stack peak is the the maximum amount of stack that the task ever used.  So, for example if you have configured your tasks to have a stack of 1024, but the stack peak only shows 300 or some number lower, then you know that 1024 stack size is overkill, and you can reduce the stack size to say 512 in this example case.

    Hope this helps,

    Steve