-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Improve memory exhaustion warnings/errors #4886
base: develop
Are you sure you want to change the base?
Conversation
P.S. This simple PR has been coded on Github and I have not tested it. Sorry - but I don't have the skills or time to create a local dev environment and test it. |
You can override this value via |
@ivankravets said:
(P.S. Flash is all or nothing - it is RAM which is more nuanced.) |
I tried this and it didn't work. |
Could you provide your INI file on how you declared these lines? |
Sorry, this is a my typo. See updated #4886 (comment) The JSON path must be split with |
@ivankravets I tried the dotted parameter name in the same place in the ini file and it didn't reduce the target ram size from 8k to 6.5K as it should have. Sorry. The documentation page is here and it says exactly what you suggested, so it should have worked. {Sigh} Edit: I moved it from a sub-[env] section to the main [env] section and it worked. 👍 Thanks for pointing this out and helping me get there. However whilst it is a potential second class alternative, it does not meet the use case of this PR. |
Firmware typically pre-allocates RAM memory where it can, and then remaining memory is used for dynamic allocation and the stack.
Currently excessive RAM usage is only a warning and not an error, which means that you are not alerted by a build failure but instead need to scan the PIO RUN output to see whether RAM usage is too high for the build. But in any case, typically firmware requires a certain amount of RAM to be available after the pre-allocation that is calculated by PIO, and you need to alerted when the remaining memory falls below this required free-memory amount.
This PR does two things: