Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15484

Heap fragmentation / memory with webservers/http clients

$
0
0

Recently I spent a lot of time trying to track down some heap issues on an ESP32 project (Arduino framework). In the end it seems like everything is OK: heap goes up and down but doesn't actually continually decline. (The issue was due to underlying caches, network stack, etc.)

So far so good, but during my research/education I saw some comments along the lines of "if you are going to use the web server libraries or HTTP clients on your ESP32 / Arduino / whatever you may have to accept that heap fragmentation will eventually get you and you need a watchdog thread or periodic reboots".

I am indeed using web servers (one for soft AP, one for STA), and like I said, so far the heap isn't a problem even under heavy webserver load, but I'm curious how true that advice is these days -- is some heap creep "inevitable" with these libraries?

I'm using WebServer, which IIUC is an ESP32 implementation on top of WiFiServer. It only allows a single connection at a time. My very-non-expert perusal of that code suggests that it's fine in terms of memory (i.e. not going to leak or build up fragmentation) but I only explored that top layer.

Anyone have experience with the robustness of WebServer or WiFiServer in terms of long-term heap usage?

Thanks!

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 15484

Trending Articles