SlideShare a Scribd company logo
1 of 48
Unit II - Storage management
 Logical Address is generated by CPU while a program is
running.
 The logical address is virtual address as it does not exist
physically, therefore, it is also known as Virtual Address.
 This address is used as a reference to access the physical
memory location by CPU.
 The term Logical Address Space is used for the set of all
logical addresses generated by a program’s perspective.
 The hardware device called Memory-Management Unit is
used for mapping logical address to its corresponding
physical address.
Differ in execution time
 It identifies a physical location of required data in a
memory.
 The user never directly deals with the physical
address but can access by its corresponding logical
address.
 The program needs physical memory for its
execution, therefore, the logical address must be
mapped to the physical address by MMU before they
are used.
Parameter LOGICAL ADDRESS PHYSICAL ADDRESS
Basic generated by CPU
location in a memory
unit
Visibility
User can view the logical
address of a program.
User can never view
physical address of
program.
Generation generated by the CPU Computed by MMU
Access
The user can use the logical
address to access the physical
address.
The user can indirectly
access physical
address but not
directly.
Editable Logical address can be change.
Physical address will
not change.
Also called virtual address. real address.
 Swapping is a memory management scheme in
which any process can be temporarily
swapped from main memory to secondary
memory so that the main memory can be made
available for other processes.
 It is used to improve main memory utilization.
 In secondary memory, the place where the
swapped-out process is stored is called swap
space.
 It is the type of memory allocation
method. When a process requests the memory,
a single contiguous section of memory blocks
is allotted depending on its requirements.
Fixed-size Partition Scheme
 In this type of contiguous memory allocation
technique, each process is allotted a fixed size
continuous block in the main memory.
 This technique is also called static partitioning.
Variable-size Partition
 In this type of contiguous memory allocation
technique, no fixed blocks or partitions are made in
the memory.
 In Operating Systems, Paging is a storage
mechanism used to retrieve processes from the
secondary storage into the main memory in the form
of pages.
 The main idea behind the paging is to divide each
process in the form of pages. The main memory will
also be divided in the form of frames.
 One page of the process is to be stored in one of the
frames of the memory.
 The partitions of secondary memory are called
as pages.
 The partitions of main memory are called
as frames.
 Address generated by CPU is divided into:
◦ Page number (p) - used as an index into a page table
which contains base address of each page in physical
memory.
◦ Page offset (d) - combined with base address to define
the physical memory address that is sent to the memory
unit. It refers to the number of bits necessary to
represent a certain word on a page, For ex: 10 bits
 Segmentation method works almost similarly
to paging, only difference between the two is
that segments are of variable-length whereas,
in the paging method, pages are always of
fixed size.
Segment table contains mainly two information
about segment:
 Base: It is the base address of the segment
 Limit: It is the length of the segment.
Example of Segmentation in OS
 Consider that a user program has been divided into
five segments and they are numbered from segment 0
to segment 4, as you can see them in the logical
address space.
 You also have a segment table which has entries for
these segment with their base address in physical
memory and their limit.
 Virtual memory is a memory management
technique where secondary memory can be
used as if it were a part of the main memory.

 Demand paging is a memory management
scheme employed by modern operating
systems to manage physical memory
resources.
 Demand paging is a process in which data is moved
from secondary memory to RAM on a demand basis,
which means all data is not stored in the main
memory because the space is limited in RAM.
 Demand Paging is a method in which a page is
only brought into main memory when the CPU
requests it.
 In an operating system that uses paging for memory
management, a page replacement algorithm is
needed to decide which page needs to be replaced
when a new page comes in.
FIFO
LRU
OPTIMAL
Page Replacement Algorithms:
 Page fault/ Miss: If the searching page is not in
memory
 Page Hit: If the searching page that was available in
memory.
 This is the simplest page replacement
algorithm.
 Replaced the pages that has been in memory
for the longest time
Example 1: Consider page reference string
1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the
number of page faults.
Advantages
 This algorithm is simple and easy to use.
 FIFO does not cause more overhead.
Disadvantages
 This algorithm does not make the use of the frequency
of last used time rather it just replaces the Oldest
Page.
 There is an increase in page faults as page frames
increases.
 The performance of this algorithm is the worst.
 In this algorithm, pages are replaced which would not be
used for the longest duration of time in the future
Advantages of OPR
 This algorithm is easy to use.
 This algorithm provides excellent efficiency and is less
complex.
 For the best result, the implementation of data structures is
very easy
Disadvantages of OPR
 Practical Implementation is not possible because the
operating system is unable to track the future request
Example-2: Consider the page references 7, 0, 1, 2, 0, 3, 0, 4,
2, 3, 0, 3, 2, 3 with 4 page frame. Find number of page fault.
 In this algorithm, page will be replaced which is least
recently(Long back) used.
 The page that has not been used for the longest time
in the main memory will be selected for replacement.
 This algorithm is easy to implement.
 Example-3: Consider the page reference
string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3
with 4 page frames. Find number of page
faults.
Advantages of LRU
 It is an efficient technique.
 With this algorithm, it becomes easy to identify the
faulty pages that are not needed for a long time.
 It helps in Full analysis.
Disadvantages of LRU
 It is expensive and has more complexity.
 There is a need for an additional data structure.
 In this algorithm, page will be replaced which has
been used recently.
 This is the Last in First Out algorithm and works
on LIFO principles.
 In this algorithm, the newest page is replaced by the
requested page.
Example: Let’s see how the LIFO performs for
our example string of 3, 1, 2, 1, 6, 5, 1, 3 with
3-page frames:
Advantages
 Simple implementation:
 Low overhead:
Disadvantages
 Poor performance:
 May result in page thrashing: LIFO page
replacement algorithm can result in a situation known
as page thrashing, where the pages are frequently
swapped in and out of memory, leading to high page
fault rates and poor system performance.
 THANK YOU

More Related Content

Similar to Logical vs Physical Address Mapping

Similar to Logical vs Physical Address Mapping (20)

CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
CSI-503 - 8.Paging and Segmentation
CSI-503 - 8.Paging and SegmentationCSI-503 - 8.Paging and Segmentation
CSI-503 - 8.Paging and Segmentation
 
Mem mgt
Mem mgtMem mgt
Mem mgt
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
 
Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
OSCh10
OSCh10OSCh10
OSCh10
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OS
 
OS_Ch10
OS_Ch10OS_Ch10
OS_Ch10
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
Module 4 memory management
Module 4 memory managementModule 4 memory management
Module 4 memory management
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Memory management
Memory managementMemory management
Memory management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
OS virtual memory
OS virtual memoryOS virtual memory
OS virtual memory
 

More from DivyaKS18

System calls in OS.pptx
System calls in OS.pptxSystem calls in OS.pptx
System calls in OS.pptxDivyaKS18
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptxDivyaKS18
 
OS introduction.pptx
OS introduction.pptxOS introduction.pptx
OS introduction.pptxDivyaKS18
 
exception -ppt.pptx
exception -ppt.pptxexception -ppt.pptx
exception -ppt.pptxDivyaKS18
 
monte carlo simulation
monte carlo simulationmonte carlo simulation
monte carlo simulationDivyaKS18
 
mac-protocols
mac-protocols mac-protocols
mac-protocols DivyaKS18
 
SMTP and TCP protocol
SMTP and TCP protocolSMTP and TCP protocol
SMTP and TCP protocolDivyaKS18
 
Multithreading -Thread Fundamentals6.pptx
Multithreading -Thread Fundamentals6.pptxMultithreading -Thread Fundamentals6.pptx
Multithreading -Thread Fundamentals6.pptxDivyaKS18
 

More from DivyaKS18 (10)

UNIX.ppt
UNIX.pptUNIX.ppt
UNIX.ppt
 
System calls in OS.pptx
System calls in OS.pptxSystem calls in OS.pptx
System calls in OS.pptx
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 
OS introduction.pptx
OS introduction.pptxOS introduction.pptx
OS introduction.pptx
 
exception -ppt.pptx
exception -ppt.pptxexception -ppt.pptx
exception -ppt.pptx
 
DES
DES DES
DES
 
monte carlo simulation
monte carlo simulationmonte carlo simulation
monte carlo simulation
 
mac-protocols
mac-protocols mac-protocols
mac-protocols
 
SMTP and TCP protocol
SMTP and TCP protocolSMTP and TCP protocol
SMTP and TCP protocol
 
Multithreading -Thread Fundamentals6.pptx
Multithreading -Thread Fundamentals6.pptxMultithreading -Thread Fundamentals6.pptx
Multithreading -Thread Fundamentals6.pptx
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 

Logical vs Physical Address Mapping

  • 1. Unit II - Storage management
  • 2.  Logical Address is generated by CPU while a program is running.  The logical address is virtual address as it does not exist physically, therefore, it is also known as Virtual Address.  This address is used as a reference to access the physical memory location by CPU.  The term Logical Address Space is used for the set of all logical addresses generated by a program’s perspective.  The hardware device called Memory-Management Unit is used for mapping logical address to its corresponding physical address.
  • 3.
  • 5.  It identifies a physical location of required data in a memory.  The user never directly deals with the physical address but can access by its corresponding logical address.  The program needs physical memory for its execution, therefore, the logical address must be mapped to the physical address by MMU before they are used.
  • 6.
  • 7.
  • 8. Parameter LOGICAL ADDRESS PHYSICAL ADDRESS Basic generated by CPU location in a memory unit Visibility User can view the logical address of a program. User can never view physical address of program. Generation generated by the CPU Computed by MMU Access The user can use the logical address to access the physical address. The user can indirectly access physical address but not directly. Editable Logical address can be change. Physical address will not change. Also called virtual address. real address.
  • 9.  Swapping is a memory management scheme in which any process can be temporarily swapped from main memory to secondary memory so that the main memory can be made available for other processes.  It is used to improve main memory utilization.  In secondary memory, the place where the swapped-out process is stored is called swap space.
  • 10.  It is the type of memory allocation method. When a process requests the memory, a single contiguous section of memory blocks is allotted depending on its requirements.
  • 11. Fixed-size Partition Scheme  In this type of contiguous memory allocation technique, each process is allotted a fixed size continuous block in the main memory.  This technique is also called static partitioning.
  • 12.
  • 13. Variable-size Partition  In this type of contiguous memory allocation technique, no fixed blocks or partitions are made in the memory.
  • 14.
  • 15.  In Operating Systems, Paging is a storage mechanism used to retrieve processes from the secondary storage into the main memory in the form of pages.  The main idea behind the paging is to divide each process in the form of pages. The main memory will also be divided in the form of frames.  One page of the process is to be stored in one of the frames of the memory.
  • 16.  The partitions of secondary memory are called as pages.  The partitions of main memory are called as frames.
  • 17.
  • 18.
  • 19.  Address generated by CPU is divided into: ◦ Page number (p) - used as an index into a page table which contains base address of each page in physical memory. ◦ Page offset (d) - combined with base address to define the physical memory address that is sent to the memory unit. It refers to the number of bits necessary to represent a certain word on a page, For ex: 10 bits
  • 20.
  • 21.  Segmentation method works almost similarly to paging, only difference between the two is that segments are of variable-length whereas, in the paging method, pages are always of fixed size.
  • 22. Segment table contains mainly two information about segment:  Base: It is the base address of the segment  Limit: It is the length of the segment.
  • 23. Example of Segmentation in OS  Consider that a user program has been divided into five segments and they are numbered from segment 0 to segment 4, as you can see them in the logical address space.  You also have a segment table which has entries for these segment with their base address in physical memory and their limit.
  • 24.
  • 25.  Virtual memory is a memory management technique where secondary memory can be used as if it were a part of the main memory. 
  • 26.
  • 27.  Demand paging is a memory management scheme employed by modern operating systems to manage physical memory resources.
  • 28.  Demand paging is a process in which data is moved from secondary memory to RAM on a demand basis, which means all data is not stored in the main memory because the space is limited in RAM.
  • 29.  Demand Paging is a method in which a page is only brought into main memory when the CPU requests it.
  • 30.
  • 31.
  • 32.  In an operating system that uses paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when a new page comes in. FIFO LRU OPTIMAL
  • 33. Page Replacement Algorithms:  Page fault/ Miss: If the searching page is not in memory  Page Hit: If the searching page that was available in memory.
  • 34.  This is the simplest page replacement algorithm.  Replaced the pages that has been in memory for the longest time
  • 35. Example 1: Consider page reference string 1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the number of page faults.
  • 36. Advantages  This algorithm is simple and easy to use.  FIFO does not cause more overhead. Disadvantages  This algorithm does not make the use of the frequency of last used time rather it just replaces the Oldest Page.  There is an increase in page faults as page frames increases.  The performance of this algorithm is the worst.
  • 37.  In this algorithm, pages are replaced which would not be used for the longest duration of time in the future Advantages of OPR  This algorithm is easy to use.  This algorithm provides excellent efficiency and is less complex.  For the best result, the implementation of data structures is very easy Disadvantages of OPR  Practical Implementation is not possible because the operating system is unable to track the future request
  • 38. Example-2: Consider the page references 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 with 4 page frame. Find number of page fault.
  • 39.  In this algorithm, page will be replaced which is least recently(Long back) used.  The page that has not been used for the longest time in the main memory will be selected for replacement.  This algorithm is easy to implement.
  • 40.  Example-3: Consider the page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 with 4 page frames. Find number of page faults.
  • 41. Advantages of LRU  It is an efficient technique.  With this algorithm, it becomes easy to identify the faulty pages that are not needed for a long time.  It helps in Full analysis. Disadvantages of LRU  It is expensive and has more complexity.  There is a need for an additional data structure.
  • 42.  In this algorithm, page will be replaced which has been used recently.  This is the Last in First Out algorithm and works on LIFO principles.  In this algorithm, the newest page is replaced by the requested page.
  • 43. Example: Let’s see how the LIFO performs for our example string of 3, 1, 2, 1, 6, 5, 1, 3 with 3-page frames:
  • 44. Advantages  Simple implementation:  Low overhead: Disadvantages  Poor performance:  May result in page thrashing: LIFO page replacement algorithm can result in a situation known as page thrashing, where the pages are frequently swapped in and out of memory, leading to high page fault rates and poor system performance.
  • 45.
  • 46.
  • 47.