Solution
The correct answer is option 4.
Key Points
3 pages of physical memory mean 3 frames (so at a time only max 3 pages in frames)
5 pages of virtual memory mean 5 page
FIFO (First In, First Out)
The operating system uses this algorithm to keep track of all pages in memory in a queue, with the oldest page at the top. When a page has to be replaced, the first page in the queue is chosen for replacement.
Page faults= A B C D A B E C D B A
| A |
D |
D |
D |
E |
E |
E |
B |
B |
| B |
B |
A |
A |
A |
C |
C |
C |
A |
| C |
C |
C |
B |
B |
B |
D |
D |
D |
Page faults= 11
Least Recently Used –
In this algorithm, the page will be replaced which is the least recently used.
Page faults= A B C D A B E C D E B A
Page faults= 12
| A |
D |
D |
D |
E |
C |
C |
C |
B |
B |
| B |
B |
A |
A |
A |
A |
D |
D |
D |
A |
| C |
C |
C |
B |
B |
B |
B |
E |
E |
E |
∴ Hence the correct answer is (11, 12).