ESP-IDF memory usage
Posted: Fri Feb 21, 2020 4:12 pm
Hi,
I just upgraded our ESP32 firmware from 3.1.x to 3.2.x and then to 3.3.1. Unfortunately it seems that the RAM footprint increased dramatically:
In our next hardware revision we'll try to add an external RAM chip but for all products in the field we need to support a version without the extra chip. I tried to enable support for the SPI RAM chip, but apparently that increases RAM consumption even more (even if the external RAM isn't initialized yet) so that our app fails to start up due to failed memory allocations.
How can I reduce the RAM footprint of ESP-IDF? Is there any way to debug which subsystem takes up the RAM to figure out if I can disable any more systems? Will ESP-IDF's RAM footprint keep increasing? Because at the moment it seems like we're stuck on 3.2.x with our app due to RAM shortage...
Thanks for any input!
I just upgraded our ESP32 firmware from 3.1.x to 3.2.x and then to 3.3.1. Unfortunately it seems that the RAM footprint increased dramatically:
- On 3.1.x we had about 51 kB of free RAM (as reported by esp_get_free_heap_size()). Our application is quite large.
- On 3.2.x it went down to 48 kB (which is not dramatic)
- On 3.3.1 we only have ~20 kB if free RAM, causing our app to crash occasionally during peak load when most RAM is needed. We need at least 25 kB of free RAM to be safe.
In our next hardware revision we'll try to add an external RAM chip but for all products in the field we need to support a version without the extra chip. I tried to enable support for the SPI RAM chip, but apparently that increases RAM consumption even more (even if the external RAM isn't initialized yet) so that our app fails to start up due to failed memory allocations.
How can I reduce the RAM footprint of ESP-IDF? Is there any way to debug which subsystem takes up the RAM to figure out if I can disable any more systems? Will ESP-IDF's RAM footprint keep increasing? Because at the moment it seems like we're stuck on 3.2.x with our app due to RAM shortage...
Thanks for any input!