ESP-IDF Heap analyzation
Posted: Thu Oct 26, 2023 6:03 pm
Hi!
I'm wanting to analyze the memory usage of my app, since I think there are a few memory leaks. The app ultimately crashes whenever enough data has been parsed.
I've enabled the standalone memory analyzer, which wouldn't work as intended. Printing of the memory report took so long, that the ESP32 had an watchdog timeout, thus leaving the printed out message incomplete.
I decided to switch to host based memory analyzation, after quite some trouble, I got the debugger to work (platform-io doesn't support a custom partition table location when launching the debugger, so I had to manually fire everything up)
Whenever the debugger finally halts at the required functions, the heap output file is almost empty:
Who can help me with this issue?
I'm starting openocd with:
I'm starting gdb with:
My gdbinit file contains:
I'm wanting to analyze the memory usage of my app, since I think there are a few memory leaks. The app ultimately crashes whenever enough data has been parsed.
I've enabled the standalone memory analyzer, which wouldn't work as intended. Printing of the memory report took so long, that the ESP32 had an watchdog timeout, thus leaving the printed out message incomplete.
I decided to switch to host based memory analyzation, after quite some trouble, I got the debugger to work (platform-io doesn't support a custom partition table location when launching the debugger, so I had to manually fire everything up)
Whenever the debugger finally halts at the required functions, the heap output file is almost empty:
Code: Select all
;
; Version SEGGER SystemViewer V2.42
; Author Espressif Inc
;
I'm starting openocd with:
Code: Select all
openocd -s "C:\esp-idf-5.0.1\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\share\openocd\scripts" -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "init; halt; esp32 appimage_offset 0x20000"
Code: Select all
xtensa-esp32-elf-gdb -x gdbinit .pio\build\debug\firmware.elf
Code: Select all
target remote :3333
mon esp appimage_offset 0x20000
mon reset halt
flushregs
tb heap_trace_start
commands
mon esp sysview start file://heap.svdat
c
end
tb heap_trace_stop
commands
mon esp sysview stop
end
c