-
Notifications
You must be signed in to change notification settings - Fork 165
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
Not enough memory after ~120 refresh of the same page #82
Comments
It's likely that the bug is in the firmware code. Have you looked at their open issues list? |
There is several issues in relation with memory leaks. |
Try to change the timeout to zero. In file httpserver.lua:
|
Same here, I'm serving an static html, in the second refresh it gives me the same message: "Not enought memory". |
Hi, I also have this issue. Says there: "Generally, this error means that "OS" is running out of heap space (that's different heap than uPy heap). Usual cause is receiving from network too slow, or vice-versa, sending too fast. Or rather, not sending fast, but sending too little data per packet, which causes too many packets allocated." Together with the fact, that our send does not use the callback sent function to know when the send is finished I suspect, that the sending is not working properly yet. Or am I overseeing something? In the nodemcu doc is says explicitely, "Multiple consecutive send() calls aren't guaranteed to work (and often don't) as network requests are treated as separate tasks by the SDK. Instead, subscribe to the "sent" event on the socket and send additional data (or close) in that callback. See #730 for details." So hopefully I will be able to sort out the concurrent stuff together with the send and callback on the wekend. |
I'm also experiencing this using just http.post() to a local IP address URL. I get about 70 "HTTP client: Connection timeout" lines before the unit crashes and restarts. As long as the HTTP requests complete without errors, everything is fine though. 🤔 |
OK the stuff above about the wrong usage of send was crap. (I found the on sent callback ;-) |
@HHHartmann so your changes fix this? |
I am just preparing an automatic test to test this. Will have a PR latest this weekend |
Will this help client requests too? Or just the server? |
@coderkevin I ama fraid I don't understand the question. @marcelstoer It might fix this issue. But there seems to be a problem freeing memory of closed connections in the nodemcu which should be fixed in the new 2.1 release. Will test with nodemcu 2.0 and 2.1 these days I added PR #92 which automates the task of reloading the same page and counts the reloads. |
OK here is what I found requests before failure
The new nodemcu releases some memory of the TCP connections faster (10 sec instead of 60) |
Hello,
I've just tested the latest version with a esp8266-01 (1MB flash)
I added only html/index.html with a little content
<H1>OK</H1>
I can load the content with my browser, but I made a test : refresh ~120x the page...then the esp crashed (not enough memory)...
I have the same problem with my home-made version of a http server...I think there is a memory-leaks with the socket management, but where?
The text was updated successfully, but these errors were encountered: