Suppose that the number of instructions executed between page fault is…
2015
Suppose that the number of instructions executed between page fault is directly proportional to the number of page frames allocated to a program. If the available memory is doubled, the mean interval between the page faults is also doubled. Further, consider that a normal instruction takes one microsecond, but if a page fault occurs, it takes 2001 microseconds. If a program takes 60 sec to run, during which time it gets 15,000 page faults, how long would it take to run twice as much memory were available?
- A.
60 sec
- B.
30 sec
- C.
45 sec
- D.
10 sec
Attempted by 118 students.
Show answer & explanation
Correct answer: C
Key idea: doubling memory doubles the mean interval between page faults, so the page-fault rate is halved.
Step 1: Find the total number of instructions executed (N) from the given data.
Each normal instruction takes 1 µs; each page-faulting instruction takes 2001 µs.
Given 15,000 page faults and total time 60 s = 60,000,000 µs, write the total time:
Total time = (N - 15,000)*1 + 15,000*2001
Solve: (N - 15,000) + 30,015,000 = 60,000,000 ⇒ N - 15,000 = 29,985,000 ⇒ N = 30,000,000 instructions.
Step 2: Compute new runtime when memory is doubled.
Doubling memory halves the page-fault count to 7,500.
New total time = (30,000,000 - 7,500)*1 + 7,500*2001
Compute 7,500*2001 = 15,007,500, and (30,000,000 - 7,500) = 29,992,500.
So new total time = 29,992,500 + 15,007,500 = 45,000,000 µs = 45 s.
Answer: 45 seconds.
Brief intuition: halving the page-fault rate saves the large extra time caused by faults, reducing total runtime from 60 s to 45 s.
A video solution is available for this question — log in and enroll to watch it.