Skip to content
BetterDL

Volatile memory

Also called: volatile storage

Memory that loses its contents when the power is removed. SRAM and DRAM, and so ordinary RAM, are volatile.

Volatile memory needs power to remember. Switch it off, even briefly, and the stored bits are lost. When power returns, the contents are unpredictable until something writes them again.

Why it happens depends on the cell:

  • An SRAM cell is a latch, a loop of two inverters. Without power the inverters stop driving and the loop forgets.
  • A DRAM cell is charge on a tiny capacitor, which leaks away within milliseconds once refresh stops.
  • Registers and flip-flops are volatile for the same reason as SRAM.

Volatile memories are the fast, freely rewritable ones, so a computer does its work in them. But it can't start from them: at power-on they hold nothing useful. That's why every system pairs its RAM with some non volatile memory holding the start-up firmware.

Two separate questions describe a RAM cell, and it pays to keep them apart:

  • Does it survive power-off? (volatile vs non-volatile)
  • Does it need refresh while powered? (static vs dynamic)

SRAM answers "no" to both: it's volatile, but needs no refresh.

PowerRAM data validFlash data retained

Worked examples

Example

Sorting memories

Which of these are volatile: SRAM, DRAM, flash, EEPROM, mask ROM, a register?

  1. 1.

    SRAM: volatile (latch cell).

  2. 2.

    DRAM: volatile (capacitor cell).

  3. 3.

    A register: volatile (flip-flops).

  4. 4.

    Flash, EEPROM and mask ROM: non-volatile. They keep their contents with the power off.

Example

A power cut

A laptop is editing a document in DRAM. The battery dies before the file is saved to its SSD (flash).

  1. 1.

    The DRAM contents are lost: the unsaved edits are gone.

  2. 2.

    The flash keeps the last saved version.

  3. 3.

    On restart, the firmware in non-volatile memory boots the machine and the saved file is reloaded into RAM.

Common mistakes

  • Calling SRAM non-volatile because it's "static". Static only means no refresh; SRAM still loses everything at power-off.

  • Thinking volatile means unreliable while powered. Volatile memory holds data perfectly as long as power (and, for DRAM, refresh) continues.

Practice Volatile memory

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Volatile memory is taught in Memory.