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

Free jsonBuffer after printing #930

Merged
merged 1 commit into from
Jun 13, 2018
Merged

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Jun 13, 2018

Solving heap problems from #896. Limited testng prefilling eeprom with bunch of "a"*64 strings and accessing /config when websocket is active.
For example, _onGetConfig method when settings size is 3236/4096

state getFreeHeap() jsonBuffer.size()
initial 22512 40
after settingsGetJson() 14768 4370
after printTo() 12528 4370
after clear() 20544 0

@@ -186,6 +190,8 @@ String _haGetConfig() {
}
output += "\n";

jsonBuffer.clear();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. meant this.

This is not technically required bc buffer will be deconstructed each iteration. Just a reminder that it can be removed after serialization in done.

@xoseperez xoseperez merged commit 95c748e into xoseperez:dev Jun 13, 2018
@mcspr mcspr deleted the clear-cfg-jsonbuf branch June 21, 2018 21:12
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