Operating Systems
1. A process in a paged system accesses the following virtual addresses:
10, 11, 104, 170, 73, 309, 185, 245, 246, 434, 458, 364
Derive the corresponding reference string if the page size is 100 words, 200 words, and 300 words.
2. A two-dimensional 512 x 512 array is stored in row major in a paged virtual memory with a page size of 512. Thus, each row occupies 1 page. Physical memory contains fewer than 512 frames.
(a) Using FIFO page replacement, determine how many page faults occur when accessing all elements sequentially:
in row major
in column major
(b) Would the number of page faults be different under LRU page replacement?
3. Physical memory consists of 4 page frames, initially all 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 under the second chance page replacement algorithm. Indicate when page faults occur.
(b) Assume that references to page 1 are write references (modifying page 1) and all others are read references. Show which pages are resident under the third chance page replacement algorithm. Indicate when page faults occur.
4. 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.
5. For d = 5 and the reference string
1 0 0 0 0 0 0 1 1 3 0 0 0 1 5 1 5 4 4 2 0 0 4 4
(a) What is the largest working set the reference string will require?
(b) What is the smallest working set the reference string will require?