Heap Task Tracking Issues
Posted: Mon Aug 11, 2025 3:24 pm
I'm trying to use Heap Task Tracking to debug some issues with memory leaks.
Calling heap_caps_print_all_task_stat_overview or heap_caps_print_all_task_stat causes a deadlock in my project because fprintf/vfprintf which is used by those functions ultimately causes heap_caps_malloc to be called, which attempts to update the task heap tracking statistics (via heap_caps_update_per_task_info_alloc), which are locked by a mutex at the start of those functions!
In the example (https://github.com/espressif/esp-idf/tr ... king/basic) this doesn't appear to happen since the fprintf calls never appear to try to allocate heap. I can't work out why the example behaves differently.
Is this expected behaviour, or am I doing something wrong here? =]
Cheers!
Calling heap_caps_print_all_task_stat_overview or heap_caps_print_all_task_stat causes a deadlock in my project because fprintf/vfprintf which is used by those functions ultimately causes heap_caps_malloc to be called, which attempts to update the task heap tracking statistics (via heap_caps_update_per_task_info_alloc), which are locked by a mutex at the start of those functions!
In the example (https://github.com/espressif/esp-idf/tr ... king/basic) this doesn't appear to happen since the fprintf calls never appear to try to allocate heap. I can't work out why the example behaves differently.
Is this expected behaviour, or am I doing something wrong here? =]
Cheers!