Storage Devices and Network Hardware: Question 3

Syllabus 3.3

Structured 4 marks

A student's laptop has 8 gigabytes of RAM. The student opens a video editor, a web browser with many tabs, and several other applications until all of the RAM is completely full. Instead of crashing or refusing to open anything else, the laptop keeps running, although everything becomes noticeably slower.

(a) Explain what the operating system does, using the laptop's secondary storage, so that it can keep running once RAM is completely full. [2]

(b) State two reasons why the laptop runs more slowly once it starts relying on this, instead of everything fitting in RAM alone. [2]

Show worked solution Hide worked solution

Worked solution

Part (a): Creating and using virtual memory

Once RAM is completely full, the operating system cannot simply store more data in RAM, so it creates virtual memory: a reserved area on the laptop’s secondary storage that acts as an extension of RAM. The operating system organises data into pages, and moves pages that are not currently needed out of RAM and into this area on secondary storage. When one of those pages is needed again, it is transferred back into RAM, if necessary swapping out a different page that is not currently in use. This constant transferring of pages between RAM and virtual memory is what lets the laptop keep running smoothly (from the user’s point of view) even though RAM itself is full.

Part (b): Why this makes the laptop slower

Two separate reasons can be credited here, one mark each.

  1. Secondary storage is much slower to read from and write to than RAM. Whenever the laptop needs a page of data that has been swapped out into virtual memory, it must wait for that page to be read back from the comparatively slow secondary storage, rather than reading it almost instantly from RAM.
  2. Moving pages between RAM and secondary storage takes extra time. Each swap in or out is additional work for the operating system that would not be needed at all if everything already fitted in RAM alone.

The more the laptop has to rely on virtual memory, the more of this slower, extra paging activity it needs, which is felt as the whole system running more slowly.

Final answers

  • (a) The operating system uses part of secondary storage as virtual memory, moving pages of data between RAM and virtual memory as needed, so the laptop keeps running once RAM is full.
  • (b) (1) Secondary storage is slower to access than RAM, so retrieving swapped-out data takes longer than reading it from RAM. (2) Swapping pages between RAM and secondary storage takes extra time/overhead that would not be needed if everything already fitted in RAM.