본문 바로가기

Labs · 9618 A2 16.1

Page Replacement

Virtual memory in action. Pages come in, but RAM has only a few frames. Choose which page to throw out, and count the page faults.

5 levelsFree bench

In the exam

9618/31 October/November 2022 · Question 8 · 4 marks

(a) Explain what is meant by virtual memory. (b) State one difference between paging and segmentation.

Points that gain marks

  • Secondary storage (disk) is used to extend the memory.
  • So the CPU seems to be able to use more memory than there is RAM.
  • Only the data in use needs to be in RAM: pages are swapped between RAM and disk when needed.
  • Paging uses blocks of a fixed size; segmentation uses blocks of different sizes.

In this lab: Each page fault in the lab is a swap: a page comes in from disk, and the page in that frame goes out.

9618/32 October/November 2023 · Question 5 · 5 marks

(a) Outline the reasons why an operating system may need to use virtual memory. (b) Explain the circumstances in which disk thrashing could occur.

Points that gain marks

  • (a) Virtual memory is used when RAM is running low, for example when many processes run at once.
  • (a) Pages that are not needed now can be moved out of RAM, so RAM is used efficiently.
  • (b) Thrashing can happen when virtual memory is used: pages move often between main memory and secondary storage.
  • (b) As main memory fills up, more pages are swapped in and out, with a very high rate of disk head movement.
  • (b) In the end more time is spent swapping pages than processing data.

In this lab: Levels 'Hits and page faults' and 'More frames, more faults?'.

More real experiments

All labs →

로그인 또는 계정 만들기

IGCSE, A-Level & AP