heap_4.c

Hi, I’m using heap4.c for the memory management of dynamic allocation for kernel objects in the heap. Does the API xPortGetFreeHeapSize() gives me the total amount of heap space that remains unallocated includes the fragmented memory or without the fragmented memory ? fragmented memory is the memory that I cannot use for memory allocation. Thank you Michael

heap_4.c

It gives you the total amount of free memory – it doesn’t tell you anything about how that memory may be fragmented. https://www.freertos.org/a00111.html