4.5.4 How Can I Reduce RAM Usage?

Try the following suggestions to reduce RAM usage:

  1. 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:

    4.5.3 How Can I Make My Code Smaller?

  2. Rather than pass large objects to (or from) functions, pass pointers that reference these objects (to save stack resources).
  3. Objects that do not need to change throughout the program can be located in program memory using the -mconst-in-code option and the const qualifier. This frees up precious RAM, but slows execution. Refer to the following section of this user’s guide:

    11.3 Variables in Program Space