-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP8266WebServer: Heap-leak and delay on aborted HTTP-requests #4892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you please try with latest git version of the core ? |
I just downloaded the master from the repository. So I tried copying the new libraries to the old folder (2.4.1) to get the linker use the old script. |
Are you using the arduino IDE ? |
I normaly use Visual Studio with vMicro. So now I used the Arduino IDE and it runs with the master. The hole program is faster now, the loading time of the image was reduced from 60ms to 40ms. |
OK, I will try to reproduce |
I tried this and while the heap goes down initially it does stabilize and even recovers somewhat. I am using a version of git, 2018-05-11. Heap |
I don't know if it's related, but I just left a comment with a kind of similar problem on this issue: #4823 |
@d-a-v implemented some patches to aggressively dispose of tcp per-connection memory structures in 2.4.2. The purpose was to avoid what appeared as a memory leak (but which, given enough idle time, the TCP backend would eventually free). It fixed the same behaviour the original but was seeing. I've run the sketch given with git head and left my finger on the F5 for quite a while, occasionally checking the reported stats. They are rock solid at 46-47kb free heap, so I think we're good here. |
Uh oh!
There was an error while loading. Please reload this page.
Basic Infos
Platform
Settings in IDE
Problem Description
I have an issue with the ESP8266WebServer.
If my HTTP request is completed, everything works perfectly fine.
But if the request gets disrupted / aborted, the webserver seams to run into some kind of timeout or unhandled error.
The next request takes time to get processed (2sec. with Core 2.3.0 even longer >10s) and the free heap gets reduced every time the issue occures by 1032 bytes.
To reconstruct the issue, I wrote a simple example, where a 10KByte picture is requested via the browser.
Press the F5 key extremly fast 2 times in a row, so that the second request is faster issued than the old request is received, then the issue occures.
http://192.168.4.1/abc
Doesn't exist and so the notFound page is displayed, where the FreeHeap is shown.
Here is the .ino and the hex-dump of the picture.
webServer.zip
Hopefully I could clarify my issue.
Best regards,
Magnus.
MCVE Sketch
Debug Messages
The first request is aborted from the browser and directly requested again.
The second request is delayed.
The text was updated successfully, but these errors were encountered: