createTask function:heap_caps_get_free_size(MALLOC_CAP_8BIT) and heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT), observed a decrease in free memory, verified task creation and deletion with uxTaskGetNumberOfTasks(), and reviewed other code sections for leaks but found none.malloc(1024) remains in memory even after the task is deleted with vTaskDelete(NULL). Since you’re not freeing the buffer using free(buffer), this memory isn’t returned to the heap, leading to the Heap Allocation Failed error after several iterations.