Primary storage (memory)
Primary storage
Primary storage is memory the CPU can access directly. It holds data and instructions the computer is using, or needs when it starts. Primary storage is fast, but most of it loses its contents when the power is off.
| Feature | RAM | ROM |
|---|---|---|
| Full name | Random access memory | Read-only memory |
| Volatile? | Yes: contents are lost without power | No: contents are kept without power |
| Can it be changed? | Yes, while programs run | Not normally by the user |
| Used for | Programs and data currently in use | Start-up instructions and firmware |
A game being played is loaded into RAM. The instructions needed to start a device are stored in ROM.
Key terms
Cache and virtual memory
Cache is very fast, small memory in or close to the CPU. It keeps frequently used instructions and data so the processor can get them sooner than from RAM. A larger cache may hold more of these useful items, but cache is more expensive per byte than RAM.
Virtual memory uses part of secondary storage as temporary space when RAM is full. The operating system moves data between RAM and this space. An SSD or hard disk is much slower to access than RAM, so frequent moving makes programs respond slowly. Virtual memory lets more programs remain open, but it does not make RAM faster or replace it.
Common mistake
Virtual memory is space on secondary storage, not extra RAM chips. It is slower because storage devices have longer access times than RAM.