An Arduino Uno R3 has 32 KB of flash, 2 KB of SRAM and 1 KB of EEPROM. What is each memory used for?
Flash holds the program, SRAM holds the variables while it runs, and EEPROM keeps small settings across power cycles.
The three memories differ in whether they survive power loss and how often they can be written:
| Memory | Keeps data without power? | Holds | Constraint |
|---|---|---|---|
| Flash (32 KB) | Yes | The compiled program (the "sketch"); about 0.5 KB is taken by the bootloader | Written when you upload new firmware, not during normal running |
| SRAM (2 KB) | No | Global variables, the stack, the heap; everything the program changes at runtime | Fast and unlimited writes, but tiny and lost on reset |
| EEPROM (1 KB) | Yes | Small persistent values: a calibration offset, a device ID, a counter | Byte-writable but wears out, roughly 100,000 write cycles per cell |
The 2 KB of SRAM is the one that bites in practice. A few string literals, a buffer for a serial line and a recursive function can exhaust it, and the result is not an error message but a stack colliding with the heap, which corrupts variables at random. That is why embedded C avoids dynamic allocation and large local arrays.
The newer Arduino Uno WiFi Rev2 (ATmega4809) raises this to 48 KB flash and 6 KB SRAM with 256 bytes of EEPROM, which is still tiny next to the ESP32's 520 KB of SRAM.
Tip: Flash = the program, SRAM = the scratchpad, EEPROM = the notebook.
Go deeper:
Arduino Docs — UNO R3 — the official board page with the ATmega328P's memory, clock and pin specifications.