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

Stabilize when running without MQTT #29

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

pzbitskiy
Copy link

  • Original version drained "free heap" as shown on the /status page from 43% to 22% in one hour that lead hanging on /control page load. Sometimes it triggered reboot.
  • New code does not have such issue, "free heap" shows 42-39% all the time and /control page continues to work.

This is possible related to #1

* Original version drained "free heap" as shown on the /status page
  from 43% to 22% in one hour that lead hanging on /control page load.
  Sometimes it triggered reboot.
* New code does not have such issue, "free heap" shows 42-39% all the
  time and /control page continues to work.
@pzbitskiy
Copy link
Author

pzbitskiy commented Jun 24, 2024

I'm not sure what exactly helped with memory consumption.
I checked both mqtt client fork and esp8266 String implementation, and cannot spot an issue - empty string assignment calls assignment operator that copies into internal buffer, and it gets destructed later anyway.
I also checked ArduinoJson, using a global static StaticJsonDocument looks OK even they do not recommend global JsonDocument and using String types because of copying. I'm not sure how do they track and destroy all String values (like from this assignments rootInfo["mode"] = hpGetMode(currentSettings)) but looks working fine - having memory usage stable.

@pzbitskiy
Copy link
Author

An update: uptime is 9d w/o MQTT with 40-42% free heap. Couple days ago LED become ON. Today I added HA + MQTT, no memory issues for few hours.

@dzungpv dzungpv merged commit 893483d into dzungpv:master Jul 16, 2024
@dzungpv
Copy link
Owner

dzungpv commented Jul 16, 2024

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants