Open enough browser tabs and your RAM fills up, yet the computer keeps going. It borrows space from secondary storage as virtual memory. Cloud storage borrows space too, but on someone else's servers across the internet.
Virtual memory is an area of secondary storage (HDD or SSD) used as if it were extra RAM when RAM is full. Data is split into pages; pages not currently needed are moved from RAM to virtual memory, and moved back into RAM when needed. It lets a computer run programs that need more memory than its RAM holds. Cloud storage keeps data on remote physical servers, owned by a provider, that are accessed over the internet, in comparison to storing data locally on the user's own devices.
Fig. 1: when RAM is full, an idle page is moved to virtual memory so a needed page can be brought into RAM
Section 01
Virtual memory.
The CPU can only use instructions and data that are in RAM. If the open programs need more space than RAM has, the operating system makes room using virtual memory.
Created: the operating system sets aside an area of the HDD or SSD to act as virtual memory.
RAM fills: data and programs in RAM are divided into fixed-size blocks called pages.
Page out: when RAM is full, pages that are not currently being used are transferred from RAM to virtual memory.
Page in: when a page in virtual memory is needed, it is transferred back into RAM (another idle page may be moved out to make room), so the CPU can access it.
Examiner trap
The CPU never processes data directly from virtual memory. A page must be moved back into RAM before it can be used.
Section 02
Why it is needed.
Virtual memory is a safety net, not a replacement for RAM.
Why necessary: without it, when RAM is full, programs could not be opened or might crash; virtual memory lets more (or larger) programs run than RAM alone allows.
The cost: secondary storage is much slower than RAM, so moving pages back and forth slows the computer down.
Disk thrashing: if pages are swapped in and out so often that the computer spends more time transferring pages than running programs, performance drops badly.
Fix: adding more RAM means fewer pages need to be swapped.
Worked example Explain the slowdown
A computer with 4 GiB of RAM becomes very slow when many programs are open. Explain why, and suggest an improvement.
The programs need more than 4 GiB, so RAM is full.
Pages are transferred between RAM and virtual memory on secondary storage.
Secondary storage is much slower than RAM, so each transfer wastes time.
More RAM would let more pages stay in RAM, so fewer transfers are needed.
Answer: Too much use of virtual memory; install more RAM
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
What is virtual memory?
Quick check+10 XP
What is transferred between RAM and virtual memory?
Quick check+10 XP
Why does heavy use of virtual memory slow a computer down?
Quick check+10 XP
Where is data in cloud storage actually kept?
Section 03
Cloud storage.
Cloud storage means saving files to storage owned by a provider, reached over the internet. The cloud is not magic: it is made of physical servers and storage devices in data centres.
Advantages of cloud storage (compared with local)
Disadvantages of cloud storage (compared with local)
Files can be accessed remotely, from any device, anywhere with an internet connection
Needs an internet connection: no connection, no access
Easy to share files and work on them with other people
Upload and download can be slow, especially for large files
The provider handles backups, so data is not lost if a local device fails or is stolen
Security and privacy risk: data is held by a third party and could be hacked
Capacity can be increased easily; no need to buy and maintain local storage hardware
Ongoing subscription costs for larger amounts of storage
The user relies on the provider: if it has an outage or closes, data may be unavailable
Your turn
A photographer stores all her photos only in the cloud. Give one advantage and one disadvantage of this.
Advantage: she can access them from anywhere (or they are backed up if her laptop is stolen). Disadvantage: she cannot access them without an internet connection (or there is a security/privacy risk).
Examiner trap
Do not say cloud storage "does not use physical storage". Cloud data is still stored on physical servers; the user simply does not own or look after them.
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
When is a page moved from virtual memory back into RAM?
Exam style+20 XP
Which is an advantage of cloud storage compared with local storage?
Exam style+20 XP
Which is a disadvantage of cloud storage?
Exam style+20 XP
Which best explains why virtual memory is necessary?
Skill unlocked
Virtual memory and cloud storage, mastered.
This skill is now recorded on your profile. Keep the chain going.