Virtual memory is used when RAM is full. The operating system uses part of the secondary storage (such as a hard drive or SSD) as if it were extra RAM, allowing the computer to continue running more programs than physical RAM alone could support.
Key points
Definition:Virtual Memory: a section of secondary storage used as an extension of RAM when RAM is full.
When RAM is full, the OS moves data NOT currently in use from RAM to virtual memory on secondary storage, freeing up RAM for new data.
When the moved data is needed again, it is SWAPPED BACK into RAM (possibly replacing other data).
Virtual memory is MUCH SLOWER than RAM because secondary storage has slower read/write speeds.
Common Mistake:Saying virtual memory 'replaces' RAM. It is a SUPPLEMENT — used only when RAM is full. It does not replace the need for RAM.
Exam Tip:Excessive use of virtual memory causes 'disk thrashing' — constant swapping between RAM and secondary storage, which significantly slows the computer.
Common Mistake:Saying 'a section of PRIMARY storage is used as VM'. VM uses SECONDARY storage (HDD/SSD), not primary.
Common Mistake:Saying 'data from ROM is transferred into VM'. Data from RAM is transferred to VM, NOT from ROM.
Common Mistake:Saying 'data from VM is transferred back to secondary storage'. Data from VM is transferred back to RAM when needed.
Exam Tip:Embedded systems (e.g. cruise control) may NOT need VM because they only run one program with a small amount of data, so RAM is unlikely to be full.