Skip to content
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

Minimize RAM usage with webserver #2031

Closed
stefanbode opened this issue Feb 26, 2018 · 4 comments
Closed

Minimize RAM usage with webserver #2031

stefanbode opened this issue Feb 26, 2018 · 4 comments
Labels
stale Action - Issue left behind - Used by the BOT to call for attention

Comments

@stefanbode
Copy link
Contributor

stefanbode commented Feb 26, 2018

Hi @arendst, with the latest modifications my TLS version really struggle with the WEB interface. The issue is caused by the REPLACE functionality. Depending on the size of the page the memory is too low. Is there an option to replace in chunks of 1024 byte for example instead of the full page?

I do not know if this really solves the issue, but maybe an idea, if the overhead is reasonable. Without the TLS MQTT there is ~21kByte of RAM which is plenty enough. With the TLS this goes down to 8kByte.

My current workaround is to disable MQTT temporary and reboot. I will also try, but your coding is much better than mine :-)
It might work best if we replace line by line. So tokenize by \r.

@arendst
Copy link
Owner

arendst commented Feb 26, 2018

Chunks won't work. Had that a few versions ago where most screens did not show. Apple hardware was very bad using chunked data. Chunk docs also mention minimum chunk sizes of 2k which makes management again very difficult.

As noted in the user_config.h I do not support TLS AND webserver at the same time. If it did work for you you were lucky. YMMV.

@stefanbode
Copy link
Contributor Author

I arendst. The idea was to chunk the replace on the String "page". So do a replace line by line instead of the complete String in the hope it will consume less memory. I made in my code some changes by introducing a page2 String and do the replace in a smaller string before adding it to page. For me it looks like there is some benefit to get at least "working" webpages (buttons are grey and not blue) unless there are more than 8300 bytes of heap. The replace in func ShowPage(); I skip if the memory is low. Header and footer are wrong, but the interface is useable.

@stale
Copy link

stale bot commented Jun 6, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Jun 6, 2018
@stale
Copy link

stale bot commented Jun 21, 2018

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Action - Issue left behind - Used by the BOT to call for attention
Projects
None yet
Development

No branches or pull requests

2 participants