This guide gives you the debug tools to identify the cause of memory-related errors and some tips and techniques to help get your CircuitPython project running again.
When creating a new project or adapting an existing one, sometimes you can run into storage or memory-related errors that stand in your way. First, it's important to understand the type of error you're getting so you will know which solutions to try.
Types of storage: Non-volatile and volatile
Items in non-volatile storage retain their values even after power is turned off, so this is used for storing files on the CIRCUITPY drive (.py files, libraries, bitmaps and font files). This non-volatile type of storage is sometimes called "Flash memory" or "EEPROM".
Volatile memory is often called "RAM" or "Random Access Memory". RAM is really fast to read and write, so it's used for storing all the active variables in your code.
Microcontrollers have differing amounts of non-volatile and volatile memory.
As your project gets more complex, you may run into situations where you reach the limit of the microcontroller's non-volatile Flash storage or its volatile memory. This guide gives you techniques to identify the root cause of memory-related errors and helps you squeeze as much as you can out of a given microcontroller board.
If your code still runs into limitations with memory-usage, you can consider finding another microcontroller board with more capability. But before switching boards, it's best to identify the root cause of what is using up your storage and memory.