Virtual memory

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Virtual memory

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Virtual memory is an area of secondary storage that the computer uses as extra RAM.
A False
B True
2. Which statement about virtual memory is correct?
A It is faster than real RAM
B It is slower than real RAM
3. When does a computer start to use virtual memory?
A When physical RAM is full
B When the computer is switched off
4. Where is virtual memory located?
A An area of the hard drive or SSD
B A separate chip on the motherboard
5. Virtual memory acts as an extension of RAM.
A True
B False

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1virtual memory Aspeed(RAM) > speed(virtual memory)
2RAM full -> use virtual memory Bvirtual memory = area of HDD/SSD
3Virtual memory acts as an extension of RAM, so it is stored on the hard drive or SSD CVirtual memory is slower than RAM, not faster, because it is held on secondary storage.
4Virtual memory is slower than real RAM because secondary storage has slower access speeds DVirtual memory is not extra RAM hardware. It is an area of the hard drive or SSD used as if it were RAM.
5virtual memory = extra chips added to the RAM EAn area of secondary storage (HDD or SSD) that the computer uses as extra RAM when real RAM is full
6speed(virtual memory) > speed(RAM) FWhen physical RAM has no free space, the computer uses part of secondary storage as extra RAM

Definitions

virtual memory

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF ramFull = TRUE THEN ________________() ENDIF
2.
IF _______ = TRUE THEN useVirtualMemory() ENDIF
3.
isSlower ← virtualSpeed _ ramSpeed
4.
totalRam ← realRam + _____________
5.
IF ramFull = TRUE ____ useVirtualMemory() ENDIF

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A IF ram_free > needed THEN
B USE virtual_memory
C STORE page ON disk
D ENDIF
Question 2
A ram_full ← TRUE
B IF ram_full = TRUE THEN
C extra ← ROM
D ENDIF
Question 3
A vm_area ← area_of_HDD
B speed ← FASTER_THAN_RAM
C OUTPUT speed
Question 4
A IF ram_full THEN
B page ← oldest_page_in_RAM
C MOVE page TO CPU
D ENDIF
Question 5
A name ← virtual_memory
B uses ← RAM_or_ROM
C OUTPUT name, uses

Answer Key

Virtual memory
Section A: Quick Questions
Q1
B — True
Q2
B — It is slower than real RAM
Q3
A — When physical RAM is full
Q4
A — An area of the hard drive or SSD
Q5
A — True
Section B: Match the Pairs
Q1
virtual memory → An area of secondary storage (HDD or SSD) that the computer uses as extra RAM when real RAM is full
Q2
RAM full -> use virtual memory → When physical RAM has no free space, the computer uses part of secondary storage as extra RAM
Q3
Virtual memory acts as an extension of RAM, so it is stored on the hard drive or SSD → virtual memory = area of HDD/SSD
Q4
Virtual memory is slower than real RAM because secondary storage has slower access speeds → speed(RAM) > speed(virtual memory)
Q5
virtual memory = extra chips added to the RAM → Virtual memory is not extra RAM hardware. It is an area of the hard drive or SSD used as if it were RAM.
Q6
speed(virtual memory) > speed(RAM) → Virtual memory is slower than RAM, not faster, because it is held on secondary storage.
Section C: Definitions
Q1
virtual memory — Part of secondary storage (HDD or SSD) that the computer uses as extra RAM when real RAM is full. It is slower than RAM.
Section D: Fill in the Blanks
Q1
IF ramFull = TRUE THEN useVirtualMemory() ENDIF
Q2
IF ramFull = TRUE THEN useVirtualMemory() ENDIF
Q3
isSlower ← virtualSpeed < ramSpeed
Q4
totalRam ← realRam + virtualMemory
Q5
IF ramFull = TRUE THEN useVirtualMemory() ENDIF
Section E: Spot the Error
Q1
A — Virtual memory is needed when there is NOT enough free RAM, so the test should be ram_free < needed. With > the program would use virtual memory when RAM has plenty of space.
Q2
C — When RAM is full, the extra memory comes from virtual memory, which is part of secondary storage. ROM is read-only and cannot act as extra RAM.
Q3
B — Virtual memory is on a hard drive or SSD, which is slower than real RAM. The line should be speed ← SLOWER_THAN_RAM.
Q4
C — Pages are moved out of RAM into virtual memory, which is an area of the disk (secondary storage). They are not moved to the CPU. It should be MOVE page TO disk.
Q5
B — Virtual memory is an area of secondary storage, so it uses an HDD or SSD. It is not made from RAM or ROM chips.