Professional Documents
Culture Documents
CSI3131 Assignment 4
CSI3131 Assignment 4
Groupe 138
Question 1
A page-replacement algorithm should minimize the number of page faults. We can
achieve this minimization by distributing heavily used pages evenly over all of memory, rather than
having them compete for a small number of page frames. We can associate with each page frame
a counter of the number of pages associated with that frame. Then, to replace a page, we can search
for the page frame with the smallest counter.
We will set the initial values for the counters to 0, the counters should be increasing only when a page
fault is present in the page frame. If a page fault is detected, the page will be set to memory with a
value of 1. The page with the smallest number will be replaced. If there are pages with the same
number of occurrences, we follow a FIFO structure to remove pages.
b)
c)
11 page faults were recorded