-
Notifications
You must be signed in to change notification settings - Fork 13.3k
1.6.5-1106-g8253b82 version has leak memory ? #780
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
I'm not aware of this issue yet. Would you mind sharing the code which triggers this issue? Regarding version names, the thing which follows [arduino]$ git diff --name-only a39ce29..8253b82
build/build_board_manager_package.sh
build/shared/tools/ESP8266FS/make.sh
build/shared/tools/ESP8266FS/src/ESP8266FS.java
hardware/esp8266com/esp8266/boards.txt
hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp
hardware/esp8266com/esp8266/cores/esp8266/HardwareSerial.cpp
hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c
hardware/esp8266com/esp8266/cores/esp8266/spiffs_api.cpp
hardware/esp8266com/esp8266/cores/esp8266/spiffs_hal.cpp
hardware/esp8266com/esp8266/doc/reference.md
hardware/esp8266com/esp8266/libraries/DNSServer/src/DNSServer.cpp
hardware/esp8266com/esp8266/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp
hardware/esp8266com/esp8266/libraries/ESP8266AVRISP/src/ESP8266AVRISP.h
hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp
hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiClient.h
hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp
hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiClientSecure.h
hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/include/ssl.h
hardware/esp8266com/esp8266/platform.txt
hardware/esp8266com/esp8266/tools/sdk/lib/libaxtls.a |
Sort of same issue here. Already during compile time it shows a large drop in available memory for variables. Running exactly the same sketch on two staging releases: So suddenly 5912 bytes more taken by sdk or other libraries? What could have happened here? |
Doesn't look like the same issue. Original issue is
|
@igrr I did not trigger what generate the different behaviour yet , as change behavior was really obvious using my project : https://github.com/luc-github/ESP8266 Anyway, I have noticed on this warning when compiling: and here compiling output (sorry it is in french - I need to switch windows to English): For http://arduino.esp8266.com/versions/1.6.5-1084-ga39ce29/package_esp8266com_index.json: Le croquis utilise 366 160 octets (84%) de l'espace de stockage de programmes. Le maximum est de 434 160 octets. For http://arduino.esp8266.com/versions/1.6.5-1106-g8253b82/package_esp8266com_index.json: Le croquis utilise 402 916 octets (92%) de l'espace de stockage de programmes. Le maximum est de 434 160 octets. |
@mvdbro This might be the axTLS library linked to your code no matter used or not .. |
Seems what ever I do I am in SoftAP+ Client with latest staging, when I am supposed to be Client only as i use
here the debug of previous staging which start in client as requested, this include my own debug including the dump of EEPROM to verify data are not corrupted
and this is with current staging:
is there a way to ensure module is is sta mode only or softAp only ? |
I still have memory drop between 2 staging from 27K to 21K but now memory stay around 21K Edit: wrong statement this change is not the root cause |
@iggr It's not my sketch issue anyway. These are compiler results with the example hello server sketch: |
The 5kb free heap reduction is mostly due to SSL stuff pulled in. I'll look into optimizing that. |
That is odd :
work as expected I unplug/plug my ESP then I get :
Unplug/ plug and back to STA mode I tried several modules and all same |
I moved all file listed here from current staging to previous staging :
And cannot reproduce the issue - also I cannot see the Because if I use the current staging - I saw them immediately the error and the output line @igrr can you point me what file do this? - I suspect it is a library (binary) as I cannot find in cpp/h files and does not show up in meld (my diff tool) Thanks |
I used the sample of wifi client to get a reproductible behavior limiting the scope of root cause: here the sketch
the module alternate STA mode and SOFT_AP+ STA mode when only STA is set
not same behavior with 1.6.5-1084-ga39ce29 sorry do not know what to do to help to debug more |
I think switching between STA and AP_STA is due to a bug in this line: The code in ESP8266WiFi.cpp is getting unnecessary complicated and full of quirks such as this one. I'm going to clean up this part of the library and add some documentation as well. |
@igrr your are the best - I did the modification and now it loop as STA and even does not crash
Here the new output
Thanks a lot and sorry not being efficient finding root cause - I should saw it |
Regarding free memory size reduction, so far i was able to track down 2495 bytes in .data/.rodata/.bss which are related to TLS library:
Things like default_certificate, default_private_key and PI_SUBST should be easy to get rid of, and I'll also take a look at enabling |
I guess the issue has some side effect like crashing at some restart and some memory not released and so a decrease of free memory. since I use the temporary fix, memory is average 21.5K in my project when it was 27k with previous staging, so it is not a memory leak but a static loss like the one you mention due to TLS Thanks again for your help |
Hi not sure how to debug this:
using my code with http://arduino.esp8266.com/versions/1.6.5-1084-ga39ce29/package_esp8266com_index.json (previous staging)
I always have 27k free memory when displaying web pages- web server was displaying full page as normal - wifi scan was working well, etc...
Today I moved to current staging which is : http://arduino.esp8266.com/versions/1.6.5-1106-g8253b82/package_esp8266com_index.json, without any code change.
My free memory drop to 21K then 17K after displaying 1 or 2 pages and pages are not fully displayed (first part only) or even at all and wifi scan seems randomly not working.
Looks like something is messing up. I must precise I do not use SPIFFS
I know it is normal staging version having issue as it is to be tested so my question is : is it a known issue ?
If not, how to find the change that could cause the problem ? I do not see in Github the tags 1.6.5-1084-ga39ce29 / 1.6.5-1106-g8253b82
Thanks
The text was updated successfully, but these errors were encountered: