New Page 1
Welcome to basicsofcomputer.com
 

Share This Free Knowledge With Your Friends:

Home » Virtual Memory in Operating System » Page Replacement in Operating System

Page Replacement in Operating System:

Definition and Explanation:

In a multiprogramming environment, almost all programs use probably half of their size. For example, a program of 10 pages actually uses only 5 pages. The demand paging mechanism saves the I/O time necessary to load the fives pages that are never used. In this case, the degree of multiprogramming should be increased.

Increasing the degree of multiprogramming may lead to the situation where over allocation memory could occur. This can be explained as follow:

If a page fault occurs, the operating system checks the internal page table. It determines where the desired page is on the disk but finds no more free frames for these required pages to be swapped in. The operating system has some options to solve this problem:

  • Either it terminates the user program immediately; or
     
  • It swaps out one program and frees all of its frames. It reduces the degree of multiprogramming.

Page replacement is another possibility in this situation. It frees one frame that is not currently used. It writes the contents of the frame to the disk and changes the page table to indicate this page is no longer in memory. The freed frame can now be used to hold the page for which the program faulted. The page fault processing procedure can be modified to include the page replacement mechanism:

  • Find the location of the desired page on the disk
     
  • Find a free frame. If there is a free frame, use it. Otherwise use a page-replacement algorithm to select a frame, write the selected page to the disk and change the page and frame tables accordingly
     
  • Read the desired page into the newly free frame; change the page and frame tables
     
  • Restart the user process

If there is no free frame and the page replacement mechanism takes place, two page transfers are carried out. This doubles the page fault processing time and therefore increases the effective access time.

In order to reduce this overhead, the modify bit can be used. Each page or frame has a modify bit. Setting this bit to 1 indicates that the associated page has been modified since it was read from the disk. When we select a page for replacement, we check its modified bit first. If this bit is set, we must write this page to the disk before swapping in the desired page. Otherwise, we can avoid writing this page to the disk.

Relevant Articles:

Introduction to Virtual Memory System
Demand Paging in Operating System
Page Faults/Segment Faults in Operating System
Page Replacement in Operating System
Page Replacement Algorithm in Operating System
Allocation of Frames in Operating System
Thrashing in Operating System
Working Set in Operating System
Page Size in Operating System
 
New Page 1

Basic Computer Science

   
» The Age of Information

» Types of Computer and Digital Age

» Input and Output Devices

» Storage Devices Of Computer

» Central Processing Unit

» Software: The Power Behind The Power

» Data Communication and Computer Networks

» The Nature Of Information

» The System Theory

» Transaction Processing System (TPS) and Management Information System (MIS)

» Decision Support System (DSS) and Executive Support System (ESS)

» Expert System (ES) and Office Information System (OIS)

 

Operating Systems

   
» Introduction to Operating System

» Introduction to Process Management

» Threads and CPU Scheduling

» Process Synchronization in Operating System

» Deadlocks

» Memory Management in Operating System

» Virtual Memory in Operating System

» File System Management in Operating System

» I/O and Device Management

» Security

» Linux Operating System

 

Database Management System

   
» Introduction to Database Systems

» Database System Architecture

» Database Administration and Database Development Process

» The Entity-Relationship Model

» Semantic Object Model

» Logical Database Design and Relational Data Model

» Normalization in Database

» Transformation of E-R Model into Relational Data Model

» Representing Semantic Object Model and Types of Semantic Object Model

» Physical Database Design

» Introduction to Structured Query Language (SQL)

» Implementation of Relational Database and Database Application Design

» Client Server Database Systems & Open Database Connectivity (ODBC)

 

Questions and Answers

   
» Basics of Information Technology

» Computer Architecture

» Data Communication

» Information Networks

» Fundamentals of the Internet

» Application and Uses of Computer

» Security, Copyright and The Law

» Windows Operating Systems

» Spreadsheet Software

» Process Management in CPU

» CPU Scheduling

» Process Synchronization

» Deadlocks

» Memory Management

» Database Systems

» Database System Architecture

» Database Administration and Database Development Process
 
 
New Page 1
 

Home                Dictionary                 Contact us                   About us                    Privacy policy                  Link to us                   Advertise

Copy right ©  2012