0% found this document useful (0 votes)
8 views8 pages

Osy Micro

The document is a micro project report on the LRU (Least Recently Used) Page Replacement Algorithm submitted by students of Sahyadri Polytechnic Sawarde for their diploma in Computer Engineering. It includes an introduction to the algorithm, its advantages and disadvantages, implementation methods, and an example of calculating page faults. The project aims to optimize memory usage by keeping frequently accessed pages available quickly.

Uploaded by

Dayanand Tawade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views8 pages

Osy Micro

The document is a micro project report on the LRU (Least Recently Used) Page Replacement Algorithm submitted by students of Sahyadri Polytechnic Sawarde for their diploma in Computer Engineering. It includes an introduction to the algorithm, its advantages and disadvantages, implementation methods, and an example of calculating page faults. The project aims to optimize memory usage by keeping frequently accessed pages available quickly.

Uploaded by

Dayanand Tawade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Sahyadri Shikshan Sanstha’s

SAHYADRI POLYTECHNIC SAWARDE

A
MICRO PROJECT ON
LRU (Least Recently Used) Page Replacement Algorithm
Submitted To
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
IN THE PARTIAL FULFILLMENT OF THE REQUIRMENT FOR
DIPLOMA IN COMUTER ENGINEERING
SUBMITTED BY:
Mr. Dabholkar Sanchit Sachin
Miss. Jadhav Shruti Mahesh
Mr. Tawade Dayanand Santosh
Enrollment No:-
2201080293, 2201080294, 2201080295

Under The Guidance Of


Miss. Shinde . P. A.

Academic Year: 2024-25


SAHYADRI POLYTECHNIC SAWARDE
MICRO PROJECT
Academic Year: 2024-25
TITLE OF PROJECT
LRU (Least Recently Used) Page Replacement Algorithm
Program: OSY Program Code:22516
Course: CO Course Code: CO5I
Group Details:
TITLE OF PROJECT: LRU (Least Recently Used) Page
Replacement Algorithm.

Sr Roll Enrollment Seat


Name of group members
No Number Number Number

1 Dabholkar Sanchit Sachin 3413 2201080293

2 Jadhav Shruti Mahesh 3414 2201080294

3 Tawade Dayanand Santosh 3415 2201080295

Name of Guide:
Miss. Shinde . P. A.
MAHARASHTRA STATE
BOARD TECHNICAL EDUCATION
Certificate
This is to certify that Mr. Dabholkar Sanchit Sachin, Miss. Jadhav
Shruti Mahesh, Mr. Tawade Dayanand Santosh. Roll no: 3413, 3414,
3415 Of 5th Semester of diploma in Computer Engineering of Sahyadri
Polytechnic Sawarde (Code: 0108) has completed the Micro Project
satisfactorily in subject OSY(22516) for the academic year 2024-25 as
prescribed in the curriculum.

Place: Sawarde Enrollment No: 2201080293


2201080294
2201080295
Date: ………………. Exam Seat No: ……………...

Subject Teacher HOD Principal


MICRO PROJECT REPORT

TITLE OF MICRO PROJECT: LRU (Least Recently Used) Page


Replacement Algorithm.

➢ Introduction:
If we use the recent past as an approximation of the near future,
then we would replace that page which has not been used for the
longest period of time. This is the least recently used algorithm.
LRU replacement associates with each page the time of its last
use. When a page is to be replaced. LRU chooses that page
which has not been used for the longest period of time.
We can think of this strategy as the optimal page-replacement
algorithm looking backward in time. rather than forward.
For example consider the following reference string, 7, 0, 1, 2,
0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0,1,7,0,1
By applying LRU, the first five faults are same as the optimal
replacement. When the reference to page 4 occurs, LRU sees
out of the three frames in memory, page 2 was used least
recently. The most recently used page is page 0, and just before
that page 3 was used.
Thus LRU replaces page 2, not knowing that it is about to be
used. When fault for page 2 occurs, LRU replaces page 3. Since
of the three pages in memory (0, 3, 4) page 3 is the least
recently used. No. of page faults = 12.
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
7 7 7 2 2 4 4 4 0 1 1 1
0 0 0 0 0 0 3 3 3 0 0
1 1 3 3 2 2 2 2 2 7

➢ Reference string
4 7 0 7 1 0 1 2 1 2 7 1 2
2 7
1 2 a b
a
0 1 a

7 0
4 4
Stack before a Stack after b
Use of a stack to Record the most recent page references
➢ Two implementation of LRU are:
1. Counters: Each page table entry has a time of use register and
adds to the CPU a logical clock or counter. The clock is
incremented for every memory reference. Whenever a reference
to a page is made, the contents of the clock register are copied
to the time of use register in the page table for that page. Thus
we always have the "time" of the last reference to each page.
We replace the page with the smaller time value.
2. Stack: This implementation keeps a stack of page numbers.
Whenever a page is referenced. it is removed from the stack and
put on the top. Thus the top of the stack is always the most
recently used page and the bottom is the least recently used
page.

➢ Advantages of LRU Page Replacement Algorithm:


1. LRU is actually quite a good algorithm.
2. It never suffers from Belady's anomaly.
3. LRU algorithm is very feasible to implement.

➢ Disadvantages of LRU Page Replacement Algorithm:


1. LRU algorithm is that it requires additional data structure and
hardware support.
2. Its implementation is not very easy
➢ Example: Consider the reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4,
5. Calculate the page fault using LRU Page Replacement using 3
frames.
Reference 1 2 3 4 1 2 5 1 2 3 4 5
String
Frames

1 *1 1 1 *4 4 4 *5 5 5 *3 3 3
2 *2 2 2 *1 1 1 1 1 1 *4 4
3 *3 3 3 *2 2 2 2 2 2 *5
Page Fault ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Total Page Faults 10.

➢ Conclusion:
Advantages of LRU Page Replacement Algorithm
Optimizes memory usage: The LRU algorithm keeps the pages
that are most frequently accessed in memory, which optimizes
memory usage and ensures that frequently used pages are
available quickly. Simple implementation: The LRU algorithm is
easy to understand and implement.
TEACHER EVALUATION SHEET

Name of Student: Dabholkar Sanchit Sachin Enrollment No: 2201080293


Jadhav Shruti Mahesh 2201080294
Tawade Dayanand Santosh 2201080295
Name of Program: TY. CO Semester: 5th
Course Title: OSY Code: 22516
Title of the Micro-Project: LRU (Least Recently Used) Page Replacement
Algorithm.
Course Outcomes Achieved:
1. The LRU algorithm is optimal because it reduces the number of
page faults and optimizes memory usage.
2. The LRU algorithm is easy to implement and understand. It can
be implemented using a priority queue or linked list to keep
track of the order in which pages are accessed.

Marks out of Marks out of


6 for 4for
performance performance
Roll Student Name in group in Total out of
No activity oral/ 10
presentation
(D5 Col.8)
(D5 Col.9)
3413 Dabholkar Sanchit Sachin

3414 Jadhav Shruti Mahesh

3415 Tawade Dayanand Santosh

Name and designation of the Teacher:


Miss. Shinde . P. A.

You might also like