Tool/software: TI-RTOS
Hi there,
i'm using a Launchpad-XL in my project.
Basically i create a Dynamic array of 103 char elements with the TI-RTOS function:
Memory_calloc( NULL, (SizeT)103, 0, NULL );
After some operation I delete the dynamic array with:
Memory_free( NULL, memoryPointer, (SizeT) memorySize );
To be sure that the array was deleted, I print the the Heap information before Memory_calloc and after Memory_free.
I realise this function:
void OS_MemoryHeapInfoPrint( void )
{
Memory_Stats stats;
Memory_getStats(NULL, &stats);
/* totalSize — total size (in MADUs) of heap.
totalFreeSize — current size (in MADUs) of free memory in the heap
largestFreeSize — current largest contiguous free block (in MADUs) */
UART_PRINT( "[RTOS] Total:%d - Free:%d - Largest: %d\r\n", stats.totalSize, stats.totalFreeSize, stats.largestFreeSize );
}
On UART I see that heap free memory decrease continuously.
At first iteration on UART I see:
[RTOS] Total:32768 - Free:25800 - Largest: 25800
/* Allocation and Free */
[RTOS] Total:32768 - Free:25344 - Largest: 25344
After many iteration I see:
[RTOS] Total:32768 - Free:13032 - Largest: 13032
/* Allocation and Free */
[RTOS] Total:32768 - Free:12576 - Largest: 12576
Why the Heap size decrease?
Thanks for the help!