17,029 views
35 votes
35 votes

A virtual memory system uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a process. Consider the following statements:

P: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.

Q: Some programs do not exhibit locality of reference.

Which one of the following is TRUE?

  1. Both P and Q are true, and Q is the reason for P

  2. Both P and Q are true, but Q is not the reason for P.

  3. P is false but Q is true

  4. Both P and Q are false.

3 Answers

Best answer
62 votes
62 votes

P: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.

This is true,
example : FIFO suffers from Bélády's anomaly which means that on Increasing the number of page frames allocated to a process it may sometimes increase the total number of page faults.

Q: Some programs do not exhibit locality of reference.

This is true : it is easy to write a program which jumps around a lot & which do not exhibit locality of reference.

Example : Assume that array is stored in Row Major order & We are accessing it in column major order.

So, answer is option (B). (As there is no relation between P & Q. As it is clear from example, they are independent.)

edited by
5 votes
5 votes
The answer is B. Both P and Q are true But Q is not the reason for P because page fault is concerned with page present in frame not with page nearly the page accessed recently.
2 votes
2 votes

Statement P: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.

Correct, as FIFO page replacement algorithm suffers from belady’s anomaly which states above statement.

Statement Q: Some programs do not exhibit locality of reference. Correct, Locality often occurs because code contains loops that tend to reference arrays or other data structures by indices. So we can write a program does not contain loop and do not exhibit locality of reference.

So, both statement P and Q are correct but Q is not the reason for P as Belady’s Anomaly occurs for some specific patterns of page references.

Answer:

Related questions

16 votes
16 votes
4 answers
1
go_editor asked Apr 23, 2016
6,505 views
A process, has been allocated $3$ page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequenc...