#  Memory-saving tips for CircuitPython

## Overview

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.

![](https://cdn-learn.adafruit.com/assets/assets/000/101/582/medium800thumb/led_matrices_creating_bitmap_2.jpg?1618668153)

**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.

- [Next Page](https://learn.adafruit.com/memory-saving-tips-for-circuitpython/non-volatile-not-enough-disk-space.md)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Adafruit Circuit Playground Bluefruit](https://learn.adafruit.com/adafruit-circuit-playground-bluefruit.md)
- [Adafruit PyPortal Titano](https://learn.adafruit.com/adafruit-pyportal-titano.md)
- [Adafruit MatrixPortal M4](https://learn.adafruit.com/adafruit-matrixportal-m4.md)
- [Adafruit MagTag](https://learn.adafruit.com/adafruit-magtag.md)
- [Trash-Built Robotic Fish](https://learn.adafruit.com/trash-robo-fish.md)
- [Using the Android CircuitPython Editor](https://learn.adafruit.com/using-the-android-circuitpython-editor.md)
- [MakeCode Course for Circuit Playground Express](https://learn.adafruit.com/makecode-circuit-playground-express-course.md)
- [MagTag AR Tarot Card Reading](https://learn.adafruit.com/magtag-tarot-cards.md)
- [Shadow Box Internet Clock with NeoPixel Visualization](https://learn.adafruit.com/shadow-box-internet-clock-with-neopixel-visualization.md)
- [Wirelessly Code your Bluetooth Device with CircuitPython](https://learn.adafruit.com/wirelessly-code-your-bluetooth-device-with-circuitpython.md)
- [Weather Display Matrix](https://learn.adafruit.com/weather-display-matrix.md)
- [Motorized Marble Machine](https://learn.adafruit.com/marble-run.md)
- [Sailor Moon Star Locket](https://learn.adafruit.com/sailor-moon-star-locket.md)
- [Chinese Dragon Puppet with Motion-Reactive Flame Effect](https://learn.adafruit.com/chinese-dragon-puppet-with-motion-reactive-flame-effect.md)
- [Halloween Countdown Display Matrix](https://learn.adafruit.com/halloween-countdown-display-matrix.md)
- [StarFlower NeoPixel Strand with MakeCode](https://learn.adafruit.com/starflower-neopixel-strand.md)
- [Matrix Portal Creature Eyes](https://learn.adafruit.com/matrix-portal-creature-eyes.md)
- [Program CircuitPython USB Devices with iPhone & iPad](https://learn.adafruit.com/use-circuitpython-devices-with-iphone-ipad.md)
- [Light Up Paper Dragon Wall Sconce](https://learn.adafruit.com/light-up-paper-dragon-wall-sconce.md)
