Hi
Is there any way to know the used percentage of heap in runtime ?
Thanks!
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.
Hi
Is there any way to know the used percentage of heap in runtime ?
Thanks!
You can use the Memory_getStats() function. See the man page:
http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_40_03_39/exports/bios_6_40_03_39/docs/cdoc/index.html#xdc/runtime/Memory.html#get.Stats
To get the info for the default heap, this will work:
Memory_Stats stats;
Memory_getStats(NULL, &stats);
System_printf("%d %d %d\n", stats.totalSize, stats.totalFreeSize,
stats.largestFreeSize);
Mark