Q11: Access pattern in memory

Question #11: Consider the hypothetical scenario where there are 4 pages in physical memory and 3 processes are running simultaneously on 3 different processors. Following is the access pattern which repeats over and over again.
Access pattern of P1: {a, b, b, c, b}, {a, b, b, c, b}, …
Access pattern of P2: {p, q, q, q, p}, {p, q, q, q, p}, …
Access pattern of P3: {x, x, x, y, z}, {x, x, x, y, z}, …
Which of the following is a sensible choice of 3 pages which could always remain in memory?

 

Options:

  1. b, q, x

  2. a, b, x

  3. b, p, x

  4. Can’t say

 

Solution:

Process P1 accesses ‘b’ the most, P2 accesses ‘q’ the most, and P3 accesses ‘x’ the maximum times. So if these 3 pages are present always and the remaining pages in memory can be used for other accesses. Hence, the correct answer is option 1.