117k views
3 votes
Comparing page replacement algorithms.

Physical memory is initially empty. The following reference string is processed:
0 1 4 0 2 3 0 1 0 2 3 4 2 3
(a) Show which pages are resident in an optimal working set with d = 3. Indicate when page faults occur.
Determine the average working set size.
(b) Show which pages are resident under the working set page replacement algorithm with d = 3. Indicate when page faults occur.
Determine the average working set size.

User Basbabybel
by
7.8k points

1 Answer

5 votes

Final answer:

This question compares page replacement algorithms, determining resident pages and page faults, and calculating the average working set size.

Step-by-step explanation:

In this question, we are comparing two page replacement algorithms and determining the resident pages and page faults under each algorithm, as well as calculating the average working set size.

(a) Optimal Working Set Algorithm:

  1. Initially, the physical memory is empty.
  2. When the reference string is processed, the resident pages in the optimal working set are:
  • 0, 1, 4
  • Page faults occur when each page is referenced for the first time.
The average working set size is 3/14 = 0.2143 (rounded to 4 decimal places).

(b) Working Set Page Replacement Algorithm:

  1. Initially, the physical memory is empty.
  2. When the reference string is processed, the resident pages under the working set algorithm are:
  • 0, 1, 4
  • Page faults occur when each page is referenced for the first time or when the working set size exceeds d.
The average working set size is 3/14 = 0.2143 (rounded to 4 decimal places).

User Deokant Gupta
by
8.3k points