Machine-translated by Google. Questions are authored in English.
Top

Discussion

Demand paging means that a page is brought into memory

  • A.only when it is referenced
  • B.as soon as the process starts
  • C.at fixed intervals during execution
  • D.only when the disk is idle

Answer: A

Correct answer: only when it is referenced

Demand paging loads a page only when it is actually referenced. A process begins with none of its pages resident and faults them in as it runs, which is the lazy swapper principle: never bring in a page that may not be needed. The benefits are substantial. Program startup is faster, since only the first few pages are read; less input and output is performed overall, because parts of a program never executed are never loaded; and more processes fit in memory at once, raising CPU utilisation. The alternative, prepaging, brings in a group of pages in anticipation. It reduces the number of faults if the guesses are right and wastes input and output if they are wrong, so it is used selectively - typically when a swapped-out process resumes and its working set is already known. Demand paging works only because of locality of reference: programs concentrate their accesses in small regions, so the fault rate settles low after an initial burst.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.