ERB-EspWebServer
ERB-EspWebServer copied to clipboard
Memory Leak?
Hi, first thanks for the great web server.
I have been running it for long term testing and I noticed that the heap memory seems to decline by approximately 1KB per day. I haven't really investigated it but I thought i'd bring it to your attention. I'm running on an esp-01 with a solid power circuit and pull ups/downs required with no long wires because I know that matters (breadboard adapter). I have a PC web browser connection updating every 20 seconds. Below is the verbose list from the bottom of the home page. Please note that on the first day it started with 15.2KB free, and now its down to 10.3KB. Thanks again.
Verbose List: Uptime: 3 Days, 03:59:55 Batt Voltage: 3.57V Free Heap Size: 10.304KB Hits: 7401 Unit ID: 1027.4540 My IPA: 192.168.1.117 Sketch Rev: ERB_MJ
Norm8332.
Thanks for your interest.
I too have noticed the Heap does not seem to recover if the hit rate is too high, ether from a single browser, with tabs, or multiple Internet connections. If you set the page update rate to something larger (maybe 180seconds), you may actually see the Heap recover during Idle time.
Yeah, I do/did not understand all that I have seen regarding the Heap and its size, and therefore that was the reason that I included a graph on the page. Originally when I first implemented the Server, I only had a Text printed value in the Verbose Listing, the Server would crash if the Heap went below about 17KB.
But now, with the current WIFI Send (wprintln, etc) implementation it occasionally continues to run as low as 4KB. For example, during the Great HACKADAY Internet Unplanned Stress Test, and yes, crashes are more likely with low Heap values.
Each time I start a endurance test, I find some reason to abort and start over (i.e. a software update :-)
Are you in Niagara Falls? If so I have seen your Flag, My Flag is Snohomish.
If you do not mind, I would like to publish our email exchange on my blog.
This has been a fun project, I am glad you find it entertaining.
Regards, Eldon Brown
73 - Eldon - WA0UWH - http://WA0UWH.blogspot.com/
On Sat, Sep 26, 2015 at 5:29 PM, norm8332 [email protected] wrote:
Hi, first thanks for the great web server.
I have been running it for long term testing and I noticed that the heap memory seems to decline by approximately 1KB per day. I haven't really investigated it but I thought i'd bring it to your attention. I'm running on an esp-01 with a solid power circuit and pull ups/downs required with no long wires because I know that matters (breadboard adapter). I have a PC web browser connection updating every 20 seconds. Below is the verbose list from the bottom of the home page. Please note that on the first day it started with 15.2KB free, and now its down to 10.3KB. Thanks again.
Verbose List: Uptime: 3 Days, 03:59:55 Batt Voltage: 3.57V Free Heap Size: 10.304KB Hits: 7401 Unit ID: 1027.4540 My IPA: 192.168.1.117 Sketch Rev: ERB_MJ
— Reply to this email directly or view it on GitHub https://github.com/wa0uwh/ERB-EspWebServer/issues/2.
Yeah, I'm in the NF area. I Have to look at the code more but I was thinking of adding a limit so when the memory is down to a certain point, it will return a Server Busy message before getting to the point of crashing. I noticed with further testing it does not seem to continue to loose memory permanently, just an initial drop to a certain point over a period of time. It seems to stay at that point until additional connections are made. But it does seem to recover to it's previous point when those connections stop.
-Norm
Norm,
Is you Esp available on the Internet?
Regards, Eldon Brown
73 - Eldon - WA0UWH - http://WA0UWH.blogspot.com/
On Sun, Sep 27, 2015 at 8:06 AM, norm8332 [email protected] wrote:
Yeah, I'm in the NF area. I Have to look at the code more but I was thinking of adding a limit so when the memory is down to a certain point, it will return a Server Busy message before getting to the point of crashing. I noticed with further testing it does not seem to continue to loose memory permanently, just an initial drop to a certain point over a period of time. It seems to stay at that point until additional connections are made. But it does seem to recover to it's previous point when those connections stop.
-Norm
— Reply to this email directly or view it on GitHub https://github.com/wa0uwh/ERB-EspWebServer/issues/2#issuecomment-143566617 .
Eldon,
If you're still looking for another internet accessible module, http://pucebaboon.com:16162 should be available most of the time. Let me know if you can't get to it and I'll bring it back on-line.
It's an ESP-13 with your "-MJ" revision loaded.
-John-
On 28 September 2015 at 05:26, Eldon R. Brown - WA0UWH < [email protected]> wrote:
Norm,
Is you Esp available on the Internet?
Regards, Eldon Brown
73 - Eldon - WA0UWH - http://WA0UWH.blogspot.com/
On Sun, Sep 27, 2015 at 8:06 AM, norm8332 [email protected] wrote:
Yeah, I'm in the NF area. I Have to look at the code more but I was thinking of adding a limit so when the memory is down to a certain point, it will return a Server Busy message before getting to the point of crashing. I noticed with further testing it does not seem to continue to loose memory permanently, just an initial drop to a certain point over a period of time. It seems to stay at that point until additional connections are made. But it does seem to recover to it's previous point when those connections stop.
-Norm
— Reply to this email directly or view it on GitHub < https://github.com/wa0uwh/ERB-EspWebServer/issues/2#issuecomment-143566617
.
— Reply to this email directly or view it on GitHub https://github.com/wa0uwh/ERB-EspWebServer/issues/2#issuecomment-143592596 .
On Mon, Sep 28, 2015 at 4:41 PM, John [email protected] wrote:
If you're still looking for another internet accessible module, http://pucebaboon.com:16162 should be available most of the time. Let me know if you can't get to it and I'll bring it back on-line.
WOW, thanks John,
It is fun to see another ESP Server Online,
Just wondering, your FreeHeap value is much higher than I would have expected, do you have any insight why?
Regards, Eldon Brown
73 - Eldon - WA0UWH - http://WA0UWH.blogspot.com/
Just wondering, your FreeHeap value is much higher than I would have expected, do you have any insight why?
Eldon,
No real idea why. I had an ESP03 module running an earlier version of your code and I had to change the upper limit on the heap display to 35 to see anything on the line graph (so it's not the physical unit... the current one is an ESP13).
The only real change is that I'm using a local NTP server, but I can't believe that would make any difference. It must be something to do with my build environment. I'm using version 1.6.5 of the Arduino package and building on Elementary Linux (an Ubuntu based distribution).
-John-
On 30 September 2015 at 03:02, Eldon R. Brown - WA0UWH < [email protected]> wrote:
On Mon, Sep 28, 2015 at 4:41 PM, John [email protected] wrote:
If you're still looking for another internet accessible module, http://pucebaboon.com:16162 should be available most of the time. Let me know if you can't get to it and I'll bring it back on-line.
WOW, thanks John,
It is fun to see another ESP Server Online,
Just wondering, your FreeHeap value is much higher than I would have expected, do you have any insight why?
Regards, Eldon Brown
73 - Eldon - WA0UWH - http://WA0UWH.blogspot.com/
— Reply to this email directly or view it on GitHub https://github.com/wa0uwh/ERB-EspWebServer/issues/2#issuecomment-144137336 .