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.

display amount of free heap

Hi,

I'm using TI-RTOS version "tirtos_tivac_2_12_01_33" and compiler v5.2.4 for TM4C129 controller that run on the DK129

i want to view/print the current free heap iin the runtime, so how can i do it?

i was checking the memory.c and i found the memmap() function but how can i call it? and is it propore to be used with the TI-RTOS?

Thanks,

Mohamed Fawzy

  • Mohamed,

    When using TI-RTOS, a different implementation of malloc/free is used. To get the memory heap info, use the Memory_getStats() function:

    software-dl.ti.com/.../index.html

    #include <xdc/runtime/Memory.h>
    #include <xdc/runtime/System.h>
    
    ...
    
        Memory_Stats stats;
    
        Memory_getStats(NULL, &stats);
        System_printf("%d %d %d\n", stats.totalSize, stats.totalFreeSize,
                      stats.largestFreeSize);
    
    ...
    

    Mark