-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Memory optimization #518
Comments
Made sure all debug and strings were wrapped in F(), eventually all debug strings will be moved to strings.h with precompiler flags to remove them entirely. ESP DEBUGGING IS ON
|
data : 0x3ffe8000 ~ 0x3ffe852c, len: 1324 |
Fantastic :) |
Investigate fragmentation, suspect is page html and params replace strings, user params |
Using the development branch on my ESP32 on Platformio:
And without WiFiManager:
(compiled in release mode with optimizations) Which is 385386 (~385kB) difference in flash. Is there anything I can do on my side to reduce memory usage? |
hmm, well all debugging is left in, they are not conditional, so removing all debug statements might help. There might be some cruft in dev since its still alpha that can be removed.. also there is a lot of info page stuff that I intend to make optional somehow, compiler directives for now probably. I would suspect the css additions. I can play with it, but it might be a while before I have time atm. Might want to create an issue just for this optimizations so we can select them out easily. There are also some very useful wifi helpers, that could be removed, like textual status() strings etc |
That seems like a good idea. What I was also thinking of is offering the user the option to supply his own HTML and CSS (not just the ability to append CSS, but all if the HTML/CSS). For my current use-case that would be easier than overwriting the existing CSS while being more compact. |
There IS a define check for the strings, so you can do that at compiler level if you wanted to and replace them elsewhere, problem is its still flash, in order to switch to littlefs/spiffs strings it would require code changes. |
Do you mean this define: https://github.com/tzapu/WiFiManager/blob/development/strings_en.h#L16? Despite the comment, does defining an own set of strings work by something like this? #define WIFI_MANAGER_OVERRIDE_STRINGS
const char HTTP_HEAD_START[] PROGMEM = // ...
// ...
#include <WiFiManager.h> I feel like I'd have more customization options if this function would be Lines 945 to 963 in 31be25d
This might not solve the RAM/Flash issue, though. |
Yeah, this was the first step to abstract and organize the code so it can be refactored better. That func was one of the latest additions with that in mind. |
For ESP8266 users, IRAM is a critical resource; the SSL library requires a lot of free heap and anything that reduces it is a problem. The WiFiManager is amazing, but it consumes roughly 2.3K of IRAM even when not instantiated. Are there ways to reduce WiFiManager IRAM usage when not using (or even instantiating) the WiFiManager? |
I am assuming this is all the strings, specifically the html, try removing the HTTP_STYLE css like icons and stuff and see what you find, i made a minimal version to test but it was a long time ago https://github.com/tzapu/WiFiManager/blob/master/wm_strings_en.h#L90 |
I submitted a separate issue #1587 addressing at least two problems:
|
.2 but there are include guards..? |
optimize memory usage, namely RAM
Strings
page
strings size, does it matter ?The text was updated successfully, but these errors were encountered: