data section exceeds available space in board

  • Arduino Uno
  • ESP32

You may see

Error during build: data section exceeds available space in board
Global variables use 3188 bytes (155%) of dynamic memory
Low memory available, stability problems may occur.
text section exceeds available space in board
Sketch too big

Why it happens

  • Too many long texts or big arrays.
  • Several large libraries at once (OLED, SD, audio, RFID).

How to fix it

  1. Wrap fixed texts in F(): Serial.println(F("Hello")); so they stay out of RAM.
  2. Make arrays smaller and remove libraries you don't use.
  3. Move to a board with more memory, such as a Mega or ESP32.
  4. On an ESP32 with Bluetooth and Wi-Fi together, choose Tools > Partition Scheme > Huge APP.

It worked if: Verify says dynamic memory is under about 75%.

Seen in a real run (some lines are close variants of it). Produced with Arduino CLI 1.5.1 and Arduino AVR core 1.8.8 (the same compiler the Arduino IDE uses). The ESP32 partition step is from the board menu and was not tried.

Didn't help? Search another error or ask us.