Question

<Operating System> 1. A process accesses pages in the following order (Assume all frames are initially...

<Operating System>

1. A process accesses pages in the following order (Assume all frames are initially empty):

1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6 Determine the number of page faults that will occur for the following algorithms: (Show your work!)

  1. Least Recently Used replacement algorithm with 5 frames available to the process.
    1. What is the minimum number of page faults that can occur for this process, regardless of algorithm or number of available frames? Why?

**NO IMAGE PLEASE**

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Least Recently Used Algorithm :-

Least Recently Used (LRU) algorithm is a Greedy calculation where the page to be supplanted is least as of late utilized.The thought depends on region of reference, the least as of late utilized page can't.

At whatever point another page is referred and not present in memory, Page Fault happens and Operating System replaces one of the current pages with recently required page.

Page Hit occurs when the new incoming page is found in one of the existing Pages.

Let say the page reference string 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6 .

Initially we have 5 page slots empty.

Request

1

2

3

4

2

1

5

6

2

1

Frame5

5

5

5

5

Frame4

4

4

4

4

4

4

4

Frame3

3

3

3

3

3

6

6

6

Frame2

2

2

2

2

2

2

2

2

2

Frame1

1

1

1

1

1

1

1

1

1

1

Hit/Fault

Fault

Fault

Fault

Fault

Hit

Hit

Fault

Fault

Hit

Hit

Request

2

3

7

6

3

2

1

2

3

6

Frame5

5

5

7

7

7

7

7

7

7

7

Frame4

4

3

3

3

3

3

3

3

3

3

Frame3

6

6

6

6

6

6

6

6

6

6

Frame2

2

2

2

2

2

2

2

2

2

2

Frame1

1

1

1

1

1

1

1

1

1

1

Hit/Fault

Hit

Fault

Fault

Hit

Hit

Hit

Hit

Hit

Hit

Hit

No. of Page fault:- 8

No. of Page Hit:- 12

Optimal Page Replacement Algorithm is the another page replacement algorithm. This Page Replacement Algorithm gives the minimum no. of page faults because in this algorithm, OS replaces the page that will not be utilized for the longest period of time in future.Therefore, this gives the minimum no. Of Page Faults.

In Addition to this, if the above given numerical is tried to solve by Optimal Page Replacement Algorithm then the Page fault is 7 which is minimum in all of the algorithms.

Add a comment
Know the answer?
Add Answer to:
<Operating System> 1. A process accesses pages in the following order (Assume all frames are initially...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Consider a system where 3 page frames are allocated to a process. Consider the following...

    1. Consider a system where 3 page frames are allocated to a process. Consider the following sequence of memory references: 3 2 1 0 3 2 4 3 2 1 0 4. Assuming no pages are initially in memory, how many page faults are there assuming a FIFO page replacement algorithm is used? 2. Repeat problem 1 with number of frames increased to 4. 3. Compare the number of page faults from 1 and 2. Is there Belady’s anomaly? 4....

  • Question 7 30 pts Consider the following page reference string: {1,2,3,4,1,5,6,2,1,2,3,7,6,3} Assume that the system has...

    Question 7 30 pts Consider the following page reference string: {1,2,3,4,1,5,6,2,1,2,3,7,6,3} Assume that the system has 4 page frames allocated to these 7 pages. Follow the page placement and replacement using the following three replacement algorithms: • LRU replacement • FIFO replacement • Optimal replacement How many page faults will occur for these three algorithms? Assume that all frames are initially empty, so your first unique pages will all cost one fault each USE ENCLOSED TABLES! Show all calculations in...

  • Implement the frame replacement algorithm for virtual memory Assume a computer system have 10 memory frames available inside the physical memory and is required to execute a process containing 20 pa...

    Implement the frame replacement algorithm for virtual memory Assume a computer system have 10 memory frames available inside the physical memory and is required to execute a process containing 20 pages. Assume a process P has been executed in the system and produced a sequence of 40 page demands as follows: Page demands trace of process P Demand 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 cont. Page...

  • Operating Systems Virtual Memory Management question Given the reference string of page accesses below, and an...

    Operating Systems Virtual Memory Management question Given the reference string of page accesses below, and an allocation of 3 page frames, and the Least-Frequently Used page replacement algorithm. Show the content of the frames as the references are processed, and indicate which references cause page faults. Record the #page faults. ref 1 2 3 5 4 2 5 3 4 5 1 1 3 1 4 frame1 frame2 frame3 fault(X) #faults =

  • A process references five pages, A, B, C, D, and E, in the following order: B;...

    A process references five pages, A, B, C, D, and E, in the following order: B; C; B; A; E; A; D; E; C; B; D; A Assume that the replacement algorithm is Optimal, find out the number of page faults occurring after the frame allocation is initially filled with an empty main memory with three page frames. Optimal B C B A E A D E C B D A

  • Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1,...

    Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page faults would occur for the following replacement algorithms, assuming one, two, three, four, five, six, or seven frames? Remember all frames are initially empty, so your first unique pages will all cost one fault each. • LRU replacement • FIFO replacement • Optimal replacement

  • Name Olbinna COSC414/514 Quiz3 (1) Suppose a computer has 4 physical pages, and a process referen...

    Name Olbinna COSC414/514 Quiz3 (1) Suppose a computer has 4 physical pages, and a process references its virtual pages (page o through page 7) in the following order: 021354637473355311172341 Also suppose the first four pages have been loaded in the physical memory as the following figure: Frame 0 Frame 1 Frame 2 Frame 3 a. Suppose the kernel uses First-In-First-Out (FIFO) page replacement algorithm. How many page faults would the process have? Which page references are page faults? b. Suppose...

  • Answer the following questions based on the Memory Management tasks of an Operating System. 5 Consider...

    Answer the following questions based on the Memory Management tasks of an Operating System. 5 Consider the following sequence of page references: 5, 6, 7, 6, 8, 7, 9, 5, 9, 6, 8, 9 Assuming that all frames are initially empty, indicate the contents of memory after each reference, and how many page faults are found for each of the following page replacement algorithms: First In First Out (FIFO):                                   [2 .5 M]                                               Reference String 5 6 7 6 8 7...

  • A system has 5 frames. For each of the algorithms below give the number of pages...

    A system has 5 frames. For each of the algorithms below give the number of pages faults for the reference string 43214573654632714. Show all your work. (a) FIFO (b) Optimal Algorithm (c) LRU (d) Working set Algorithm. Assume that there are 3 page reference between clock ticks. Also in case of a tie the page with the lowest number is paged out.

  • Consider the following virtual page reference sequence: page 1, 2, 3, 4, 2, 1, 5, 6,...

    Consider the following virtual page reference sequence: page 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3. This indicates that these particular pages need to be accessed by the computer in the order shown. Consider each of the following 4 algorithm-frame combinations: LRU with 3 frames FIFO with 3 frames LRU with 4 frames FIFO with 4 frames . For each of the 4 combinations, below, move from left to right as the virtual page numbers are...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT