Way of dynamic memory allocation detections
Posted: Tue Mar 20, 2018 1:32 pm
Hi ESP-IDF,
After a long trip in my home town (Da Lian, China), I started my job here (Berlin, Germany) again.
Today I'd like to know how to track memory allocation (in real time)?
I know there is a API call that track the free stack space:
And other three command for static memory usage statistic:
But how to detect if I'm out of memory indeed?
Some weeks ago I've ported open62541(OPC UA) successfully. But my OPC UA Server ran only on WIFI connection but not with Ethernet (With my Ethernet connection, I made a Webserver up & running without any issue). For the OPC UA with WIFI, I didn't add too many logic for the test. But with the Ethernet, I did add many peripheral (Ethernet, SD Card, Serial Communication...) and a little bit more code for them. So I'm blind to tell if the single problem is only because I've used up all memories from our half Mega Byte static RAM.
P.s:
the gdb got triggered & stopped pointing at a function I never called.
After a long trip in my home town (Da Lian, China), I started my job here (Berlin, Germany) again.
Today I'd like to know how to track memory allocation (in real time)?
I know there is a API call that track the free stack space:
Code: Select all
uxTaskGetStackHighWaterMark
- make size
make size-components
make size-files
But how to detect if I'm out of memory indeed?
Some weeks ago I've ported open62541(OPC UA) successfully. But my OPC UA Server ran only on WIFI connection but not with Ethernet (With my Ethernet connection, I made a Webserver up & running without any issue). For the OPC UA with WIFI, I didn't add too many logic for the test. But with the Ethernet, I did add many peripheral (Ethernet, SD Card, Serial Communication...) and a little bit more code for them. So I'm blind to tell if the single problem is only because I've used up all memories from our half Mega Byte static RAM.
P.s:
the gdb got triggered & stopped pointing at a function I never called.