Is "low memory" really a problem?

Status
Not open for further replies.

neutron7

Well-known member
Code:
Sketch uses 129,232 bytes (49%) of program storage space. Maximum is 262,144 bytes.

Global variables use 56,336 bytes (85%) of dynamic memory, leaving 9,200 bytes for local variables. Maximum is 65,536 bytes.

Low memory available, stability problems may occur.


i have not noticed any problems. there are not many local variables except for a few "i" incrementors in "for" loops etc.

Is this message left over from arduino with very small memory, or from teensy? maybe automatically checks the percentage left?

the code is almost finished and ill be optimizing it to bring the size down, i doubt it will be by much though.
 
Looks like there's a default to warn at 75%, which is probably motivated by the tiny 2K RAM in Arduino Uno.

Until now, Teensy has never defined this, so the 75% default is being used. The default also only gets used if Arduino initializes your prefs file, which is why I've never seen this before. It's been years since my prefs files were initialized from defaults on the machines I use regularly. Maybe I ought to delete them every now and then?

I'll add Teensy specific warning levels on the next 1.25 beta. Realistically, AVR boards should probably warn when you're down to about 500 bytes, and ARM boards should probably warn about 1K.
 
As always, depends ... on your application.

If you use many external libraries, that might add objects on the heap, place big things on the stack and call other libraries, you better not have to little free memory.

On the other hand, if you use very little external libraries, and you know "hope you know" that the running code will not consume a lot of stack space, then the margin can be much lower.
 
Last edited:
Status
Not open for further replies.
Back
Top