4.5.4 How Can I Reduce RAM Usage?
Try the following suggestions to reduce RAM usage:
- Some of the same suggestions for making your code smaller can be useful to reduce RAM usage, see the following section of this user’s guide:
- Rather than pass large objects to (or from) functions, pass pointers that reference these objects (to save stack resources).
- Objects that do not need to change throughout the program can be
located in program memory using the
-mconst-in-code
option and theconst
qualifier. This frees up precious RAM, but slows execution. Refer to the following section of this user’s guide: