-
Notifications
You must be signed in to change notification settings - Fork 39
Implement freeMemory() function #205
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
Comments
After a bruising experience debugging a memory leak (caused by opening SD card files and not closing them), I've written the below code. Can't for the life of me get a meaningful stack pointer result (needs updating in 2 places), but can be used to find heap-related memory leaks. I was going to do a pull request but figured you'll have a better idea of where to put it, and how to deal with the global variables - ie. char _end should be the last global variable declared for it to work properly. `//Adapted by Stephen Fordyce from code at https://forum.arduino.cc/index.php?topic=285436.0 //extern "C" char _end; #define RAM_START_ADDR 0x10010000 //Decimal: 268500992, per p71 of Apollo3 datasheet void printRAMUsage() uint32_t getTotalRAM() uint32_t getGlobalsRAM() uint32_t getHeapRAM() uint32_t getStackRAM() uint32_t getFreeRAM() |
Mentioned 2021-04-02 (that's 2nd April) on Sparkfun Forums (with some extra code that may be useful): https://forum.sparkfun.com/viewtopic.php?f=169&t=55440&p=224631#p224631 |
Closed due to inactivity. Please create a new issue if help is still needed. |
requested on SparkFun forums
https://forum.sparkfun.com/viewtopic.php?f=170&t=53270
The text was updated successfully, but these errors were encountered: