Not enough memory

Arduino Microcontroller Board

Severity: Minor

What it means

Arduino IDE 2: Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint. Then the error data section exceeds available space in board.
Arduino's code shows it when global variables use more than 100% of dynamic memory, the board's RAM.

Affected Models

  • Arduino IDE 2
  • Arduino IDE 1.8

How to Fix It

  1. Wrap fixed text in the F() macro: Serial.println(F("Test done.")). Arduino: the text then stays in program storage instead of memory.

  2. Shrink variables. Remove unused ones, use int (2 bytes) instead of long (4 bytes) where it fits, and no float for whole numbers.

  3. Make arrays only as big as needed, and declare variables inside the function that uses them, not globally.

  4. Move fixed tables into program storage with PROGMEM. Still over? Arduino: a board with more memory.