📚 Knowledge Library — Topic 3.8 — Hardware

Virtual Memory

Understand how a computer uses part of secondary storage as temporary overflow space when RAM becomes full.

1. Invitation

What happens when RAM gets full?

RAM holds the programs and data the computer is currently using.

But RAM has a limit. If it becomes full, the computer needs somewhere else to temporarily place some data.

💡 Remember: virtual memory helps the computer keep working when RAM is full.
Figure 1.1
RAM Is Full
RAM
📄 📄 📄 📄

No space left
The computer needs overflow space.
2. Big Idea

Virtual memory extends RAM.

Virtual memory is a section of secondary storage used as temporary extra space for RAM.

It is not real RAM. It is slower, but it can stop programs from crashing when memory is full.

💡 Virtual memory uses secondary storage as an extension of RAM.
Figure 2.1
RAM Extension
RAM full
+
Secondary storage

Virtual memory
3. FutureLogic Bridge

Think of a full desk.

Your desk is RAM. It holds the work you need right now.

When the desk is full, you move less urgent papers to a nearby filing box. The work continues, but reaching the filing box is slower than using the desk.

💡 Bridge: RAM is the desk. Virtual memory is the overflow box.
Figure 3.1
Desk Overflow
Desk = RAM
📄 📄 📄

Overflow box
= virtual memory
4. Worked Example

Opening one more program.

A student has many apps open. RAM becomes full.

The operating system moves data that is not needed right now into virtual memory. This frees space in RAM for the new program.

What happens?

RAM full
Old page moved
New app loads
Less-used data is moved out so active data can fit in RAM.
Figure 4.1
Page Swapping
Old page

Virtual memory

New page

RAM
5. Key Term

Pages are moved between RAM and storage.

A page is a block of data that can be moved between RAM and virtual memory.

This movement is called paging or page swapping.

💡 You do not need the deep details here. Just know that pages are swapped between RAM and virtual memory.
Figure 5.1
Pages
Page A
Page B
Page C

RAM / virtual memory
6. Exam Tip

Mention secondary storage.

In exam answers, be clear that virtual memory is created using secondary storage.

It is often described as a partitioned section of the secondary storage device.

🎯 Exam Tip: write that secondary storage is used or partitioned to create virtual memory.
Figure 6.1
Exam Wording
Secondary storage

Partitioned space

Virtual memory
7. Common Mistake

Virtual memory is slower than RAM.

Virtual memory helps the computer keep running, but it does not make the computer faster.

Secondary storage is slower than RAM, so heavy use of virtual memory can slow the computer down.

⚠️ Common Mistake: virtual memory is not extra fast RAM. It is slower overflow space.
Figure 7.1
Speed Difference
RAM
⚡ fast

Virtual memory
🐢 slower
8. Summary

Virtual memory in one screen.

Virtual memory is used when RAM is full.

It uses part of secondary storage as temporary overflow space. Pages of data can be moved between RAM and virtual memory.

This helps programs keep running, but it is slower than using RAM.

💡 Key idea: virtual memory prevents RAM from becoming a hard limit, but too much use slows the computer down.
Figure 8.1
Summary Flow
RAM full

Move page out

Load new data

Computer keeps working