 Hello friends, myself Rohit Kumar R. Vakhtarikar, working as an assistant professor in computer science and engineering department at Waltz Institute of Technology, Solarpur. Today, we are going to discuss page replacement in an operating system. Learning outcomes of the session is, at the end of the session students will be able to describe the page replacement algorithms. So, in the page replacement algorithms, we are going to perform the replacement of pages into the RAM. So, let us see what are the different types of replacement algorithms. The first is a first in first out, optimal page replacement and then least recently used page replacement. So, let us say the first in first out. So, let us see here. Let us say we have already seen what is meant by pages in our previous lecture. So, one application is divided into the pages and on demand we are going to perform swap in and swap out operations onto the pages. So, if that particular page is not available in the frame, at that time we are going to call it as a page fault. So, let us see the first in first out operation. So, let us say we will have the A, B, C, A, C, D, E are the pages. So, let us consider these are the pages and now we need to take the frame size is equals to 3. Means what? Here we will have our frame with 3 size. Means whenever we are going to perform any operations, we need to first look it into the these frames. So, here we will have the frame. Now, initially this frame is empty, fine. So, let us create some copies of this frame so that we can use it for the furthers, fine. Let us see. Now, initially these frames are empty. So, now these pages we need to add into these frames, right. So, these are nothing but our frame, fine. So, now whenever any application is looking for any pages, first of all he is going to check that page available in the frames. So, now currently this frame is empty. So, the first it will claim A. So, now it is going to check into the frame. Is there A is available? No, right. So, now here page fault is happens at this time. On this time we got our page fault, fine. So, now what we will do? We will insert the A into the frame buffer and then we will go for the page B. Page B is also not there. So, again page fault happens. So, now we are going to see the A. Is there A is available into the frame? No. So, now we are going to add this C into the frame. So, now here if you will see initially if the frame is empty. So, at that time those number of page faults are going to occur. So, now here initially we will got the three page faults. So, now we wants to add this C. Now operating system is looking for the page A. So, he is going to look into this frame. Whether that A is available into our frames, yes. A is available. So, now here it happens the page hit. So, now again he is going to check the next page C. So, whether C is available it is going to check, yes. C is also available. So, again the page it is going to be happens. So, now after that it is going to check for the D. So, now it is going to check whether the D is available, no. Now here D is not available and this one is nothing but the first in first out operation, right. This is FIFO first in first out, fine. So, now at the first we got the A into our buffer frame. So, now we need to replace this A with the D. So, now here we will get D, B and C, fine. So, now next again we are looking for this E. So, now if we look into this E. So, again page fault has been occurs because that is not available. So, now D and E are again the page faults. So, now here we need to perform the replacement of this page replacement status we need to apply. So, now what we need to do? So, now after this A we got the B into our frame buffer. So, here we need to remove this B and we need to add the E into the buffer. So, now here we got our D, E and C. So, in this way we are going to perform the first in first out page replacement strategy. So, if we will see here we need to calculate the page faults. So, if we will see into the diagram we got 1, 2, 3 then D and E. The total number of 5 page faults has been occurred in this particular example by using first in first out strategy. So, now the next, next we will see the LRU list recently used algorithm. We are going to use the same pages here fine. So, let us see what we will do? We will take this frame as it is fine and we will take the same example here. So, A, B, C, A, C, D and E fine these are the pages. So, now in the list recently used what we need to do? We need to check our list into the backward positions fine means fault. So, now we are going to solve this one then we will get what is going to happen. So, now here first we are going to check A. A is available no initially that frame is empty means what we are going to directly store this A, B and C into our frames. And now here we got three page faults this one, this one and this one fine. So, now after that the next page is A operating system is not demanding for the A. So, now it is going to check A availability in the frame yes it is available fine. Now this is the page hit and now it is going to check next C right. So, that one is also available page hit is happens. So, now it is going to check for the D. Now D is not available means again here page fault has occurs. So, now which page we are going to replace then right. So, if we will see into our backward list. So, C has been used recently A has been used recently. So, now if we will see into the list B is the page which is list recently used. So, into this frame we need to replace that B fine. So, now what we will get then A into our frame then D then C fine. So, now if we will see here again the next page we are going to see that is E. So, now E is again not available right. So, again page fault has been occurs. So, now here which page we are going to replace then with C here it is a D and C we have used recently. So, list recently used is A. So, now here we need to replace that A from our frame. So, now see here what we have done we have replaced A with E then D and then C. So, here finally the page faults we need to calculate right are total fine in this example also in the LRU fine. So, we have seen these two things fine. So, let us go for the next one that is optimal page replacement strategy. So, again we are going to take the same example here and we will have the same frame buffers fine. So, we will take this pages to here fine and we will add some more frames here. So, that next time it is going to be easy to add the pages fine. So, we will see that is one. So, now in the optimal what we need to do we need to check the future references fine. So, how we are going to do that then? So, first of all as usual we will start for the this one initially frame buffer is empty. So, we are directly going to add A then B and then C into our frame and these are the three page faults. So, now next is A it is looking for the A right. So, A is available and then C is also available right and then it is going to check the D. So, D is not available. So, again here what happens? So, let us say we will see there is one more page available that is A fine. So, now when we are going to perform this D now page fault is happens. So, now at that time which page we are going to replace then right. So, now at that time let us say we will have one more page called the C. So, now under D from here we need to look at the future. In the future we are going to use the A and C are the two pages right. So, now B is not going to use in our future. So, now at that time here we need to replace that B. So, now in the pages we will have A then we need to replace B with D and then we will got here C fine. So, now for the next time now next we are going to see this E. So, now E is available no again page fault occurs right. So, now again we need to replace this one. So, which one we are going to replace then A and C we need to use and D is not going to use right. So, now here we need to replace that D with a E right. So, now here we will got the frames. So, next time we need to check A. A is also available page hit occurs then C again page hit occurs right. So, in this way we are going to see we are going to solve the examples. So, these are the some small examples we have seen for this fine. So, which page replacement algorithm is the most efficient we have seen three. So, please answer for this question. So, we will see the here the optimal page replacement algorithm because the page faults we are getting very less in the optimals. These are the references we have used the Galvin operating system concepts. Thank you.