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

More Related Content

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

What's hot

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

Similar to Page replacement algorithms

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

More from sangrampatil81

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

Recently uploaded

PPTX
The Sync Strikes Back: Tales from the MOPs Trenches
PPTX
AI Clinic Management Tool for Dermatologists Making Skin Care Smarter, Simple...
PDF
BCA 1st Semester Fundamentals Solved Question Paper 44121
PDF
IAAM Meetup #7 chez Onepoint - Construire un Rag-as-a-service en production. ...
PDF
Bring AI and build AI agents into your Jakarta EE Apps with LangChain4J-CDI
PDF
DSD-INT 2025 Transport and Fate of Microplastics in Fluvial System (Rhine Riv...
PDF
DSD-INT 2025 Understanding the Paraguay River Response to Hard Bottom Dredgin...
PDF
SWEBOK: the software engineering body of knowledge (SC25 Workshop Research So...
PDF
DSD-INT 2025 Flood Early Warning System for the Trans-African Hydrometeorolog...
PDF
inSis suite - Laboratory Information Management System
PDF
DSD-INT 2025 REACT - Rapid E-flow Assessment and Communication Tool - Flores
PDF
DSD-INT 2025 DevOps - Automated testing and delivery of Delft3D FM - van West...
PDF
DSD-INT 2025 The Singapore Regional Model in Delft3D FM - Zijl
PDF
DSD-INT 2025 MeshKernel and D-Grid Editor - Stout
PDF
DSD-INT 2025 Building-Aware Flood and Lifeline Scour Modeling with Delft3D FM...
PDF
DSD-INT 2025 Modernizing Hydrodynamics in Large Flood Forecasting System - Mi...
PDF
Building Custom Insurance Applications With
PDF
ECFT Case Study: Digital Pilot Transportation System
PDF
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
PDF
DSD-INT 2025 Quantifying Flood Mitigation Strategies Under Sea Level Rise - H...
The Sync Strikes Back: Tales from the MOPs Trenches
AI Clinic Management Tool for Dermatologists Making Skin Care Smarter, Simple...
BCA 1st Semester Fundamentals Solved Question Paper 44121
IAAM Meetup #7 chez Onepoint - Construire un Rag-as-a-service en production. ...
Bring AI and build AI agents into your Jakarta EE Apps with LangChain4J-CDI
DSD-INT 2025 Transport and Fate of Microplastics in Fluvial System (Rhine Riv...
DSD-INT 2025 Understanding the Paraguay River Response to Hard Bottom Dredgin...
SWEBOK: the software engineering body of knowledge (SC25 Workshop Research So...
DSD-INT 2025 Flood Early Warning System for the Trans-African Hydrometeorolog...
inSis suite - Laboratory Information Management System
DSD-INT 2025 REACT - Rapid E-flow Assessment and Communication Tool - Flores
DSD-INT 2025 DevOps - Automated testing and delivery of Delft3D FM - van West...
DSD-INT 2025 The Singapore Regional Model in Delft3D FM - Zijl
DSD-INT 2025 MeshKernel and D-Grid Editor - Stout
DSD-INT 2025 Building-Aware Flood and Lifeline Scour Modeling with Delft3D FM...
DSD-INT 2025 Modernizing Hydrodynamics in Large Flood Forecasting System - Mi...
Building Custom Insurance Applications With
ECFT Case Study: Digital Pilot Transportation System
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
DSD-INT 2025 Quantifying Flood Mitigation Strategies Under Sea Level Rise - H...

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