-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
OOM debug: warn about String reallocation #7908
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it makes sense to print on every string reallocation. They are expected and normal, no? Seems like in a real app this might spew a lot of messages...
Frequent String reallocation is the ram-without-mmu fatal disease, users should fix their code or disable OOM debug. (edit1)
I'd say they are possible, silent in non-OOM debug mode, abnormal in this environment, and avoidable with (edit2) (edit3) |
Okay, I see your point and it is true that String (re)allocations can be ugly with many people's code. Maybe only spew if size is large enough to be an issue? Say, >128bytes? Reallocating from 16b to 32b isn't really a big deal, but reallocating from 768b to (768+delt) bytes is since you're going to need a massive free zone to find the space for it. |
128bytes it is, configurable in the added define |
When OOM debug is enabled: User helper to warn about misused Strings
With this sketch: