Seneca

Virtual Memory

Computer Science: OCR GCSE, topic 1.2.6

How Virtual Memory Works

Virtual Memory allows us to access more memory than we have. Virtual Memory sets aside some secondary storage space to act as extra memory.

Paging

Paging

  • Memory can be split into sections called 'pages'.
  • Virtual Memory works by moving these pages between the Random Access Memory (RAM) and the secondary storage.
Move pages to HDD

Move pages to HDD

  • If a page is not being used, then we might want to put it into Virtual Memory.
  • A page is moved to the HDD when it is not being used.
  • The page is put into a special file called the pagefile.
  • Other processes can then use the memory that we just freed in the RAM.
Move pages to RAM

Move pages to RAM

  • When we want to use a page again, we first need to move it back to the RAM.
  • We swap the page that we want with one that is already in the RAM.

Test yourself on Virtual Memory

  • Between which two storage areas does virtual memory move pages?

  • A page stored in secondary storage is needed by a program, but RAM is full. What must happen before that page can be loaded into RAM?

  • Decide which statement about virtual memory is correct in each pair.

  • Why does a page have to be moved back into RAM?

Practise this topic for free