Movatterモバイル変換


[0]ホーム

URL:


Uploaded bysangrampatil81
PPTX, PDF4,675 views

Page replacement algorithms

This document discusses different page replacement algorithms used in operating systems. It begins by explaining the basic concept of page replacement that occurs when memory is full and a page fault happens. It then describes several common page replacement algorithms: FIFO, Optimal, LRU, LRU approximations using reference bits, and Second Chance. The key aspects of each algorithm are summarized, such as FIFO replacing the oldest page, Optimal replacing the page not used for longest time, and LRU approximating this by tracking recently used pages. The document provides an overview of page replacement techniques in computer systems.

In this document
Powered by AI

Overview of page replacement concepts and the presenter details.

Introduction to the necessity for page replacement in memory management.

Explanation of page replacement and how frames are managed during a page fault.

Detailed steps on freeing frames and managing page table entries during replacements.

Discussion on how page replacement algorithms manage memory across processes.

First In First Out algorithm, its operation, and queue management for page replacement.

Illustration of FIFO page replacement with a reference string and three memory frames.

Optimal page replacement strategy, its advantages, and implementation challenges.

Least Recently Used strategy, focusing on replacing the least recently accessed pages.

Alternatives to LRU using reference bits due to hardware limitations in some systems.

A variation of FIFO that gives pages a second chance based on reference bits.

Embed presentation

Downloaded 37 times
Page ReplacementAlgorithmsPrepared By: Mr. Sangram A. PatilAssistant Professor PVPIT,Budhgaon
Need for page replacement
Basic Page Replacement Page replacement takes following approach. If no frame is free then page fault occurs and we find a frame that is not currentlybeing used and free it. We can free a space by writing its content to swap space and changing the pagetable (all other table). To indicate page is not in memory. Now we can use the freed frame to hold the page for which the process is faulted. We modify the page table entry for requested page.
Basic Page Replacement Find the location of desired page on disk. Find a free frame.1. if there is free frame use it.2. if there is no free frame use page replacement algorithm to select v victimpage3. write a victim frame to the disk. Change frame and page tables accordingly Read the desired page into the newly freed frame. Change the frame and pagetable accordingly. Restart the process.
Page replace algorithms If multiple processes are in memory then it decide how many frames allocate toeach process and when page replacement is required. Number of page replacement algorithms are available. Each OS has its own page replacement mechanism To evaluate page replacement algorithm we need string of memory references andwe computing number of page faults. String of memory reference is called reference string Need page size.
1.FIFO page replacement Simplest page replacement algorithm FIFO: First In First Out Associate with each page the time when that page was brought into memory When page must be replaced oldest page is chosen. We can create a FIFO queue to hold all pages in memory. We replace page at the head of the queue. When page is brought into memory we replace insert it at the tail of the queue.
 For our example of reference string we consider three frames. These three frames are initially empty. FIFO page replacement works as below
2.Optimal Page replacement Optimal page replacement has lowest page fault rate of all algorithms will neversuffer from Baladys Anomaly. “replace the page that will not be used for longest period of time” Difficult to implement because it requires future knowledge of reference string.
3. LRU Page Replacement LRU: Least Recently Used FIFO: uses when page is brought into memory. Optimal: Uses time when a page to be used. Replace a page that has not been used from longest period of time. When a page must be replaced, LRU choses a page that has not been used fromlongest period of time. Looking backward in time.
4. LRU Approximation Few computer system provides sufficient hardware support for LRU pagereplacement. Some system provide no hardware support and other page replacement algorithmmust be used. Many system provide reference bits. Reference bit is set by hardware whenever page is referenced. reference bit is associated with each entry in page table. Initially bits are cleared (to 0) by OS. A user process executes the bit associated with each page referenced is set (to 1)by hardware. After some time we determine which page have been used and have not been usedby examining the reference bits.
5 .Second chance algorithm Basic algorithm is FIFO algorithm. When page has been selected we check its reference bit. If it is 0 we proceed to replace this page. If it is 1 we give a page second chance and move on to select the next FIFO page. When page gets second chance its reference bit gets cleared and arrival time set tocurrent time. Thus page that is given a second chance will not be replaced until all other pageshave been replaced Implemented by using circular queue.
Page replacement algorithms

Recommended

PPTX
Virtual memory management in Operating System
PPT
Chapter 9 - Virtual Memory
PPTX
Computer architecture virtual memory
PPT
Virtual memory
PPTX
Page replacement algorithms
PPTX
Page Replacement Algorithms.pptx
PPT
Thrashing allocation frames.43
PPT
Virtual memory
PPTX
Demand paging
PPTX
Computer architecture page replacement algorithms
PPT
Paging.ppt
PPTX
Memory Management in OS
PPTX
Memory management ppt
PPT
Contiguous Memory Allocation.ppt
PPTX
Paging and segmentation
PPTX
Demand paging
PPT
Chapter 8 - Main Memory
PPTX
Operating system paging and segmentation
PPT
Chapter 11 - File System Implementation
PPTX
Inter Process Communication
PPTX
Segmentation in operating systems
PPTX
CPU Scheduling in OS Presentation
PPTX
Directory structure
PDF
Memory management
PPTX
System calls
PPTX
Operations on Processes and Cooperating processes
PPTX
Presentation on Segmentation
PPT
Page replacement
PPTX
Operating system 40 lru algorithm

More Related Content

PPTX
Virtual memory management in Operating System
PPT
Chapter 9 - Virtual Memory
PPTX
Computer architecture virtual memory
PPT
Virtual memory
PPTX
Page replacement algorithms
PPTX
Page Replacement Algorithms.pptx
PPT
Thrashing allocation frames.43
PPT
Virtual memory
Virtual memory management in Operating System
Chapter 9 - Virtual Memory
Computer architecture virtual memory
Virtual memory
Page replacement algorithms
Page Replacement Algorithms.pptx
Thrashing allocation frames.43
Virtual memory

What's hot

PPTX
Demand paging
PPTX
Computer architecture page replacement algorithms
PPT
Paging.ppt
PPTX
Memory Management in OS
PPTX
Memory management ppt
PPT
Contiguous Memory Allocation.ppt
PPTX
Paging and segmentation
PPTX
Demand paging
PPT
Chapter 8 - Main Memory
PPTX
Operating system paging and segmentation
PPT
Chapter 11 - File System Implementation
PPTX
Inter Process Communication
PPTX
Segmentation in operating systems
PPTX
CPU Scheduling in OS Presentation
PPTX
Directory structure
PDF
Memory management
PPTX
System calls
PPTX
Operations on Processes and Cooperating processes
PPTX
Presentation on Segmentation
Demand paging
Computer architecture page replacement algorithms
Paging.ppt
Memory Management in OS
Memory management ppt
Contiguous Memory Allocation.ppt
Paging and segmentation
Demand paging
Chapter 8 - Main Memory
Operating system paging and segmentation
Chapter 11 - File System Implementation
Inter Process Communication
Segmentation in operating systems
CPU Scheduling in OS Presentation
Directory structure
Memory management
System calls
Operations on Processes and Cooperating processes
Presentation on Segmentation

Similar to Page replacement algorithms

PPT
Page replacement
PPTX
Operating system 40 lru algorithm
PPT
Page Replacement
PDF
Pge Replacement Algorithm.pdf
PPTX
page replacement.pptx
PPTX
Page replacement
PPTX
Virtual memory and page replacement algorithm
PPTX
operating system notes about virtual memory 4.pptx
PPT
Operating System
PPTX
Page replacement alg
DOCX
Chosse a best algorithm for page replacement to reduce page fault and analysi...
PPTX
Page replacement algorithm
PPTX
Page replacement_Architecture ppt (213015018+213015017).pptx
PPT
Pagereplacement algorithm(computional concept)
PPTX
Page replacement algorithm
PPTX
Comparision of page replacement algorithms.pptx
PPTX
3_page_replacement_algorithms computer system and architecture
PPT
Replacement.ppt operating system in BCA cu
PPT
Explain about replacement algorithms from these slides
PPT
9415070 deepak kumar raja kumar hgdxgfgcg
Page replacement
Operating system 40 lru algorithm
Page Replacement
Pge Replacement Algorithm.pdf
page replacement.pptx
Page replacement
Virtual memory and page replacement algorithm
operating system notes about virtual memory 4.pptx
Operating System
Page replacement alg
Chosse a best algorithm for page replacement to reduce page fault and analysi...
Page replacement algorithm
Page replacement_Architecture ppt (213015018+213015017).pptx
Pagereplacement algorithm(computional concept)
Page replacement algorithm
Comparision of page replacement algorithms.pptx
3_page_replacement_algorithms computer system and architecture
Replacement.ppt operating system in BCA cu
Explain about replacement algorithms from these slides
9415070 deepak kumar raja kumar hgdxgfgcg

More from sangrampatil81

PPTX
Methods for handling deadlock
PPTX
File system structure
PPTX
Memory Management
PPTX
Operating system deign and implementation
PPTX
Disk structure
PPTX
Directory implementation and allocation methods
PPTX
File management
PPTX
Classical problems of process synchronization
PPTX
IO hardware
PPTX
Semaphore
PPTX
Deadlock
PPTX
System programs
PPTX
virtual memory
PPTX
Pointer to array and structure
PPTX
Pointer arithmetic in c
PPTX
Operating system structure
PPTX
Services and system calls
PPTX
Monitors
PPTX
System programs
PPTX
Pointer in c
Methods for handling deadlock
File system structure
Memory Management
Operating system deign and implementation
Disk structure
Directory implementation and allocation methods
File management
Classical problems of process synchronization
IO hardware
Semaphore
Deadlock
System programs
virtual memory
Pointer to array and structure
Pointer arithmetic in c
Operating system structure
Services and system calls
Monitors
System programs
Pointer in c

Recently uploaded

PDF
Fundamental of Information Systems introduction.pdf
PDF
Data Integration with Salesforce Bootcamp
PDF
Smarter Testing Safer Systems Balancing AI and Oversight in Regulated Environ...
PDF
CCM_External_Sales_Commissions_Standard_Configuration_2022-3.pdf
 
PDF
DevOps Monitoring Tools: The 2025 Guide to Performance & Observability
PPTX
Future of Software Testing: AI-Powered Open Source Testing Tools
PPTX
The Sync Strikes Back: Tales from the MOPs Trenches
PDF
DSD-INT 2025 REACT - Rapid E-flow Assessment and Communication Tool - Flores
PDF
Building Custom Insurance Applications With
PDF
DSD-INT 2025 Modernizing Hydrodynamics in Large Flood Forecasting System - Mi...
PDF
Microservices Architecture Benefits For Mobile Development.pdf
PDF
2025_11_19 - OpenMetadata Community Meeting.pdf
PDF
Oracle AI Database 26ai _ AI-Native Database for Enterprises.pdf
PDF
SCORM Cloud: The 5 categories of content distribution
PDF
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
PDF
DSD-INT 2025 Flood Early Warning System for the Trans-African Hydrometeorolog...
PDF
DSD-INT 2025 Quantifying Flood Mitigation Strategies Under Sea Level Rise - H...
PDF
DSD-INT 2025 Century-Scale Impacts of Sediment-Based Coastal Restoration unde...
PDF
DSD-INT 2025 3D Modeling of Shallow Water Dynamics Using Delft3D FM - Martins
PDF
DSD-INT 2025 Hydrodynamic and Morphodynamic Modeling with Delft3D FM for an I...
Fundamental of Information Systems introduction.pdf
Data Integration with Salesforce Bootcamp
Smarter Testing Safer Systems Balancing AI and Oversight in Regulated Environ...
CCM_External_Sales_Commissions_Standard_Configuration_2022-3.pdf
 
DevOps Monitoring Tools: The 2025 Guide to Performance & Observability
Future of Software Testing: AI-Powered Open Source Testing Tools
The Sync Strikes Back: Tales from the MOPs Trenches
DSD-INT 2025 REACT - Rapid E-flow Assessment and Communication Tool - Flores
Building Custom Insurance Applications With
DSD-INT 2025 Modernizing Hydrodynamics in Large Flood Forecasting System - Mi...
Microservices Architecture Benefits For Mobile Development.pdf
2025_11_19 - OpenMetadata Community Meeting.pdf
Oracle AI Database 26ai _ AI-Native Database for Enterprises.pdf
SCORM Cloud: The 5 categories of content distribution
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
DSD-INT 2025 Flood Early Warning System for the Trans-African Hydrometeorolog...
DSD-INT 2025 Quantifying Flood Mitigation Strategies Under Sea Level Rise - H...
DSD-INT 2025 Century-Scale Impacts of Sediment-Based Coastal Restoration unde...
DSD-INT 2025 3D Modeling of Shallow Water Dynamics Using Delft3D FM - Martins
DSD-INT 2025 Hydrodynamic and Morphodynamic Modeling with Delft3D FM for an I...

Page replacement algorithms

  • 1.
    Page ReplacementAlgorithmsPrepared By:Mr. Sangram A. PatilAssistant Professor PVPIT,Budhgaon
  • 2.
    Need for pagereplacement
  • 3.
    Basic Page ReplacementPage replacement takes following approach. If no frame is free then page fault occurs and we find a frame that is not currentlybeing used and free it. We can free a space by writing its content to swap space and changing the pagetable (all other table). To indicate page is not in memory. Now we can use the freed frame to hold the page for which the process is faulted. We modify the page table entry for requested page.
  • 4.
    Basic Page ReplacementFind the location of desired page on disk. Find a free frame.1. if there is free frame use it.2. if there is no free frame use page replacement algorithm to select v victimpage3. write a victim frame to the disk. Change frame and page tables accordingly Read the desired page into the newly freed frame. Change the frame and pagetable accordingly. Restart the process.
  • 6.
    Page replace algorithmsIf multiple processes are in memory then it decide how many frames allocate toeach process and when page replacement is required. Number of page replacement algorithms are available. Each OS has its own page replacement mechanism To evaluate page replacement algorithm we need string of memory references andwe computing number of page faults. String of memory reference is called reference string Need page size.
  • 7.
    1.FIFO page replacementSimplest page replacement algorithm FIFO: First In First Out Associate with each page the time when that page was brought into memory When page must be replaced oldest page is chosen. We can create a FIFO queue to hold all pages in memory. We replace page at the head of the queue. When page is brought into memory we replace insert it at the tail of the queue.
  • 8.
     For ourexample of reference string we consider three frames. These three frames are initially empty. FIFO page replacement works as below
  • 9.
    2.Optimal Page replacementOptimal page replacement has lowest page fault rate of all algorithms will neversuffer from Baladys Anomaly. “replace the page that will not be used for longest period of time” Difficult to implement because it requires future knowledge of reference string.
  • 11.
    3. LRU PageReplacement LRU: Least Recently Used FIFO: uses when page is brought into memory. Optimal: Uses time when a page to be used. Replace a page that has not been used from longest period of time. When a page must be replaced, LRU choses a page that has not been used fromlongest period of time. Looking backward in time.
  • 13.
    4. LRU ApproximationFew computer system provides sufficient hardware support for LRU pagereplacement. Some system provide no hardware support and other page replacement algorithmmust be used. Many system provide reference bits. Reference bit is set by hardware whenever page is referenced. reference bit is associated with each entry in page table. Initially bits are cleared (to 0) by OS. A user process executes the bit associated with each page referenced is set (to 1)by hardware. After some time we determine which page have been used and have not been usedby examining the reference bits.
  • 14.
    5 .Second chancealgorithm Basic algorithm is FIFO algorithm. When page has been selected we check its reference bit. If it is 0 we proceed to replace this page. If it is 1 we give a page second chance and move on to select the next FIFO page. When page gets second chance its reference bit gets cleared and arrival time set tocurrent time. Thus page that is given a second chance will not be replaced until all other pageshave been replaced Implemented by using circular queue.

[8]ページ先頭

©2009-2025 Movatter.jp