What you'll learn
Memory and storage covers where a computer keeps the instructions and data it needs — both while it is running and when it is switched off. In OCR GCSE Computer Science (J277, section 1.2) you must know the difference between primary storage (RAM, ROM, cache and virtual memory) and secondary storage (magnetic, optical and solid state), how to choose a storage device using capacity, speed, portability, durability, reliability and cost, and the units of data from bits to petabytes. This guide also links to data storage calculations, because questions on file sizes and storage capacity draw on this section.
The most common exam questions ask you to explain why a computer needs both RAM and secondary storage, to explain virtual memory, and to recommend a storage device for a scenario with justification.
Key terms and definitions
Primary storage — Storage that the CPU can access directly, such as RAM, ROM and cache.
Secondary storage — Non-volatile storage used to keep programs and data long term, such as HDDs, SSDs and optical discs.
RAM (random access memory) — Volatile memory that holds the operating system, programs and data currently in use.
ROM (read-only memory) — Non-volatile memory that holds the instructions needed to start the computer (the boot program or BIOS).
Volatile — Loses its contents when the power is turned off.
Non-volatile — Keeps its contents without power.
Virtual memory — Part of secondary storage used as if it were RAM when RAM is full.
Magnetic storage — Stores data by magnetising areas of a disk or tape, e.g. hard disk drives.
Optical storage — Stores data as pits and lands read by a laser, e.g. CDs, DVDs and Blu-ray.
Solid state storage — Stores data in flash memory chips with no moving parts, e.g. SSDs, USB drives and SD cards.
Capacity — The amount of data a device can store.
Durability — How well a device withstands physical damage.
Core concepts
Why computers need primary storage
The CPU can only work with data and instructions held in primary storage. When you open a program, it is copied from secondary storage into RAM, because RAM is far faster to access than a disk. RAM holds:
- the parts of the operating system currently in use;
- the programs currently running;
- the data those programs are using.
RAM is volatile: its contents are lost when the power is switched off, which is why unsaved work disappears in a power cut. RAM can be read from and written to, and its contents change constantly as you work.
ROM and the boot process
ROM is non-volatile and is typically read-only during normal use. It stores the boot-up instructions (often called the BIOS) that run as soon as the computer is switched on. These instructions test the hardware and load the operating system from secondary storage into RAM. They must be in non-volatile memory because RAM is empty when the computer starts.
RAM versus ROM
| RAM | ROM | |
|---|---|---|
| Volatility | Volatile | Non-volatile |
| Read/write | Read and write | Read-only (in normal use) |
| Contents | OS, programs and data in use | Boot-up instructions |
| Size | Gigabytes | Small |
Virtual memory
When RAM is full, the operating system moves data that is not currently being used out of RAM and into an area of secondary storage called virtual memory. When that data is needed again, it is swapped back into RAM, and something else is moved out.
Virtual memory lets the computer keep running more programs than RAM alone can hold, preventing it from crashing. However, secondary storage is much slower than RAM, so heavy use of virtual memory — sometimes called disk thrashing when data is swapped back and forth constantly — makes the computer slow. The usual fix is to install more RAM, so less swapping is needed.
Why secondary storage is needed
Secondary storage is non-volatile, so it keeps the operating system, applications and users' files when the computer is switched off. It also has far greater capacity than RAM and costs much less per gigabyte. Without it, everything would be lost at shutdown.
Magnetic storage
A hard disk drive (HDD) contains spinning platters coated with magnetic material, with a read/write head on a moving arm. Data is stored as tiny magnetised regions.
- Advantages: high capacity; low cost per gigabyte; reliable for long-term storage.
- Disadvantages: moving parts make it slower than SSDs, noisier, heavier and less durable — it can be damaged if dropped while running; it also uses more power.
Magnetic tape offers very high capacity at very low cost and is used for archiving and backups, but data must be read sequentially, so access is slow.
Optical storage
CDs, DVDs and Blu-ray discs store data as microscopic pits and lands on a reflective surface, read by a laser.
- Advantages: cheap; light and portable; easy to distribute.
- Disadvantages: low capacity compared with other media; slow; easily scratched; fewer computers now have optical drives.
Discs may be read-only (ROM), recordable once (R) or rewritable (RW).
Solid state storage
Solid state drives (SSDs), USB flash drives and SD cards use flash memory: electrical charges trapped in memory cells. There are no moving parts.
- Advantages: very fast access, so computers boot and load quickly; durable when knocked or dropped; silent; low power use, so batteries last longer; small and light.
- Disadvantages: higher cost per gigabyte than HDDs; each cell can only be rewritten a limited (though very large) number of times.
Choosing a storage device
Use the six characteristics:
- Capacity — how much data must be stored?
- Speed — how quickly must data be read or written?
- Portability — will it be carried around?
- Durability — will it be knocked, dropped or used in harsh conditions?
- Reliability — how well does it keep working over time?
- Cost — what is the budget, and the cost per gigabyte?
A video editor needs high capacity and speed (an SSD for current projects, HDDs for archives). A photographer travelling outdoors needs durable, portable SD cards. A film studio distributing a movie might use optical discs or digital download. A data centre backing up years of records might use magnetic tape.
Units of data
| Unit | Size |
|---|---|
| Bit | A single 0 or 1 |
| Nibble | 4 bits |
| Byte | 8 bits |
| Kilobyte (KB) | 1,000 bytes |
| Megabyte (MB) | 1,000 KB |
| Gigabyte (GB) | 1,000 MB |
| Terabyte (TB) | 1,000 GB |
| Petabyte (PB) | 1,000 TB |
OCR accepts either 1,000 or 1,024 as the multiplier in calculations, as long as you are consistent; many students use 1,000 for simplicity. Data is stored in binary because the computer's circuits use switches with two states, on and off.
Storage calculations
You may be asked how much storage is needed for a set of files. For example, to store 200 photos of 3 MB each: 200 × 3 = 600 MB. To see how many 5 GB films fit on a 1 TB drive: 1,000 GB ÷ 5 GB = 200 films. Always show your working and state the units.
Cloud storage
Cloud storage keeps files on remote servers accessed over the internet. It is technically secondary storage provided by someone else's hardware, usually large banks of magnetic and solid state drives in data centres.
- Advantages: files can be accessed from any device with an internet connection; storage can be increased easily; the provider manages hardware and backups; files are safe if a local device is lost or damaged; sharing and collaboration are easy.
- Disadvantages: an internet connection is needed; uploading and downloading large files can be slow; there are ongoing subscription costs; data security depends on the provider; data may be stored in another country.
Matching storage to real scenarios
| Scenario | Suitable storage | Main reason |
|---|---|---|
| Laptop for a travelling journalist | SSD | Durable, fast, low power |
| Home media server with thousands of films | HDD | High capacity, low cost per GB |
| Camera on a hiking trip | SD card (solid state) | Small, light, durable |
| Distributing a game to shops | Optical disc or download | Cheap to copy, portable |
| Company archives kept for years | Magnetic tape or cloud | Very high capacity, low cost |
Use tables like this to revise: for each device, be able to name the characteristic that makes it the best fit.
Worked examples
Example 1: Why RAM and secondary storage are both needed
Explain why a computer needs both RAM and secondary storage. (4 marks)
Answer: RAM stores the programs and data currently in use (1) and is fast so the CPU can access them quickly (1). RAM is volatile, so its contents are lost when the computer is switched off (1). Secondary storage is non-volatile, so it keeps files and programs permanently when the power is off (1).
Example 2: Virtual memory
A user has many programs open and the computer slows down. Explain why, and suggest a solution. (3 marks)
Answer: RAM has become full, so the operating system is using virtual memory on secondary storage (1). Secondary storage is much slower than RAM, so swapping data between them slows the computer (1). Installing more RAM would reduce the need for virtual memory (1).
Example 3: Recommending a device
A delivery company wants storage for drivers' tablets, which are carried in vans all day. Recommend a type of storage and justify. (3 marks)
Answer: Solid state storage (1). It has no moving parts, so it is durable and will not be damaged by knocks in the van (1). It uses little power, so the tablet's battery will last longer during the day (1).
Example 4: Storage calculation
A school stores 1,200 student reports of 2 MB each. How many gigabytes is this?
1,200 × 2 = 2,400 MB. 2,400 ÷ 1,000 = 2.4 GB.
Common mistakes and how to avoid them
- Calling RAM "storage that keeps files". RAM is volatile and only holds data in use.
- Saying virtual memory makes the computer faster. It prevents crashes when RAM is full but is slower than RAM.
- Saying ROM stores "the operating system". ROM stores the boot-up instructions that load the OS from secondary storage.
- Giving characteristics without context. "SSDs are durable" earns more when linked: "so it survives being dropped on site".
- Mixing up bits and bytes in calculations; 8 bits = 1 byte.
Exam technique for "Memory and Storage"
- For comparisons, use the six characteristics as headings in your head and pick the two or three that matter most for the scenario.
- In virtual memory questions, describe what happens (data moved to secondary storage), why (RAM full) and the effect (slower performance).
- Show every step in calculations, with units.
- Avoid brand names; use the technology type (magnetic, optical, solid state).
Quick revision summary
- Primary storage: RAM (volatile, programs and data in use), ROM (non-volatile, boot instructions), cache, and virtual memory as overflow.
- Virtual memory uses secondary storage when RAM is full — prevents crashing but is slow; more RAM is the fix.
- Secondary storage is non-volatile and needed to keep data permanently.
- Magnetic: high capacity, cheap, moving parts. Optical: cheap, portable, low capacity, scratches. Solid state: fast, durable, low power, costlier.
- Choose using capacity, speed, portability, durability, reliability, cost.
- Units: bit, nibble, byte, KB, MB, GB, TB, PB.