Professional Documents
Culture Documents
Chapter 9 (Lecutre Note 1)
Chapter 9 (Lecutre Note 1)
Virtual memory is a technique that allows the execution of processes that are not completely in
memory. Virtual memory is a method that computers use to manage storage space to keep systems
running quickly and efficiently.
2. Demand Paging
Demand paging is a process of swapping in the Virtual Memory system. In this process, all data
is not moved from hard drive to main memory because while using this demand paging, when some
programs are getting demand then data will be transferred. The demand paging system is similar to the
paging system with swapping where processes mainly reside in the main memory (usually in the hard
disk).Demand paging is the process that solves the above problem only by swapping the pages on
Demand. This is also known as lazy swapper.(It never swaps the page into the memory unless it is
needed).Swapper that deals with the individual pages of a process are referred to as Pager. Demand
Paging is a technique in which a page is usually brought into the main memory only when it is needed or
demanded by the CPU. Initially, only those pages are loaded that are required by the process immediately.
Those pages that are never accessed are thus never loaded into the physical memory.
3. What is page fault?
Page fault is a type of error that occurs when a program tries to access a page marked invalid that
is not currently in the main memory or random access memory (RAM). When this happens, the operating
system (OS) tries to retrieve the required data from the hard disk or another storage medium, and this
process is known as a page fault. The reason for the page fault to occur : 1. Failure of OS to bring the
valid page into memory 2. Due to invalid address error.
Q1. Consider the following page reference string: 3,2,1,0,3,2,4,3,2,1,0 and the Number of page frame is 3.
Using FIFO page replacement algorithm, Find the number of Page Fault.
Q2. Consider the following page reference string: 1,7,8,3,0,2,0,3,5,4,0,6,1 and the Number of page frame
is 3. Using Optima Page Replacement algorithm, Find the number of Page Fault.
Q3. Consider the following page reference string: 0, 2, 1, 6, 4, 0, 1, 0, 3, 1, 2, 1. and the Number of page
frame is .4Using FIFO page replacement algorithm, Find the number of Page Fault.
Q4. Consider the following page reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 and the Number of
page frame is 4. Using Optima Page Replacement algorithm, Find the number of Page Fault.