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.

TIRTOS Tasks out of memory problem

Other Parts Discussed in Thread: SYSBIOS

Hi TI,

I am using concerto board to develop my project.I set SYS/BIOS heap size to be 20480 (seams to be the maximum size I can set). I have got five tasks in it as shown in figures. When I was trying to debuging the project, there is always "out of memory" problem. This problem happened when I added the fifth task in it and I set the stack size to be 512. Before this, the code was working fine with four tasks in it and I even increased the stack size of one task from 2048 to 4096 (just for testing if this will cause out of memory), and it was also working fine. However, when I reduced that stack size back to 2048 and added the fifth task in it, the problem occured. Can anyone help with this ? I attached cnsole and ROV screen shots.

Many Thanks,

Ben

  • Hi,

    I think that you're really running out of memory. You're creating the tasks dynamically and they're being allocated from heap of 20480 bytes, if you add up teh stack sizes shown in ROV you have more than that. Can you try to delete those terminated tasks? Or maybe create some of them statically, so they would be created from stack memory instead of heap?

    Regards

    J

  • Hi J,

    Thanks for you reply. I actually created the tasks statically. Every task has its own fixed stack size when I created the task. I do not think I am really running out of memory. I created the fifth task that has stack size 512, and this casued the problem. However, when I deleted the fifth task and increased any task's stack size by 2048 (from 2048 to 4096), and this worked fine to me. If I am running out of memory by adding only one task then the same problem should happen when I I increased any task's stack size by 2048.

    Many Thanks,

    Ben

  • Ben,

    Can you please post your .cfg file that shows the static task creation?  Also, the code snippets for the dynamic creation of tasks?  

    And, in the ROV view, if you click on the BIOS module and the “scan for errors” tab, what is shown?

    Thanks,
    Scott

  • Scott,

    Thanks for your reply. I attached two images and the .cfg file. From the first image, you can see that the task I added was "task4" with the function "task_TCP" and with the stack size "1024". Inside this function, there is only one simple incremental syntax just for testing. And this caused the out of memory problem. The second image is the information for "scan for errors".

    Thanks for your help.

    Ben

    1106.AlbaternM3.cfg

  • Hi Ben,

    I see that you have LoggingSetup in your .cfg file.  Could you try commenting out that line and see if the problem goes away?  What version of TI-RTOS are you using?

    Best regards,

        Janet

  • Hi Janet,

    Thanks for your help. My TIRTOS version is "tirtos_1_10_00_23". I tried to stop using "Logging" in TI-RTOS system overview, but I cannot sucessfully build my code after that like shown in the first figure. The erros message is "
    Unresolved symbol ti_sysbios_utils_Load_Module__state__V in file C:\ti\tirtos_1_10_00_23\products\bios_6_35_01_29\packages\ti\sysbios\lib\sysbios\instrumented\sysbios.aem3<BIOS.obj>". I tried to debug for nearly two days and found out that the problem happened for "ndk Hooks" (shown in figure 2) if I removed "Addwebfiles" the code can be built ok. Can you advise me how to solve this problem first before I can continue.

    Many Thanks,

    Ben

  • Hi,

    Do you have the Load module in your .cfg?

    var Load = xdc.useModule('ti.sysbios.utils.Load');

    Regards

  • Hi Johannes,

    The code can now be built after adding that in the .cfg, thanks for this. I now tried to comment the LogginSetup, but this does not solve my problem. I attached the new .cfg file.

    Many Thanks,

    Ben

    0407.AlbaternM3.cfg

  • Hi Ben,

    I thought you might be running into an issue with the Load module requiring a heap, but I see now that it is not the case, since you do have a heap.  As Johannes said in an earlier post, you should delete the terminated tasks to reclaim the memory.

    Best regards,

        Janet

  • Hi Janet,

    But I think I may need this task to achieve rather than terminate.

    Thanks,

    Ben