How to tracing heap memory leak problem in ESP32?

Viewed 1142

I am using ESP32 chip to develop a project, but I found that the heap size seems to steadily decrease. I have used the:

MDF_LOGD("the free heap size is %d --root_write_task(start)", esp_get_minimum_free_heap_size());

to check every function in the main program, but still cannot find any leakage point and the IDF APP Tracer seems to be not working at all. Basically I have no output at all.

I am quite worried that I have cloned some driver to my program and caused this issue. AIs there any other way to check such an issue? I am using VSCode with the esp-idf extension.

2 Answers

The correct function to call to get the heap size is esp_get_free_heap_size(). The best way to check for memory leaks is to connect your device with JTAG and debug it in that way.

Related