ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By grooves
#14257 Hi,

first of all, thanks for sharing the project, great work,
It seems to be a small memory leak, you can check ist very easy with your design, just add:
os_sprintf(buff, "%ld %lu", hitCounter, (unsigned long)system_get_free_heap_size());
in cgi.c
you can see that the free memory gets smaller and smaller with every page call.
I'm sure you can fix that,
looking forward for OTA updates, :-)

Regards,
grooves
User avatar
By Sprite_tm
#14263 I'll look into it. I do know, however, that closed sockets tend to linger for some minutes in the esp stack. Do you happen to have checked if the memory loss persists in the longer term?
User avatar
By grooves
#14339 you are right, when there is a minute between two calls the free memory increases a little bit,
but just few bytes.
It doesn't come back to the free heap at start time,
in general it wastes memory, not much but it does

Regards,
grooves
User avatar
By krzychb
#14606 I am glad grooves brought this issue and I observe exactly the same. After each webpage load the heap size decreases. It recovers after several seconds / minutes. The problem is that no matter how long you wait between subsequent webpage loads the heap does not fully recover. I have tested it extensively with couple of latest SDKs releases including SDK v1.0.1 b1. I am using the toolchain and esphttpd copy provided under http://programs74.ru/udkew-en.html.