Jump to content

Number of page faults


zak100

Recommended Posts

Hi,

I am trying to find out the number of page faults. I have found an example question with solution:

A memory system has three frames and eight virutal pages. Consider
the reference string 01232304523143263212.
1) How many page faults will occur when FIFO, LRU, and Optimal
algorithms are used respectively?

I am trying to solve it using LRU. The solution says that LRU would generate 14 page faults and optimal would generate 10 page fault. However I am getting 10 page fault.

The solution is given below (sorry , I can't understand the solution):

My solution is:

01232304523143263212.

0 0  0     0    4     5       1      4      6   1

   1   1     3    3     3       3     3      3    3

         2    2    2     2       2     2       2    2

 

My solution is working like optimal solution. Somebody please guide me what is the between optimal and LRU.

Zulfi..


 

LRU wrong answer.jpg

Hi,

I think LRU, looks at the past referenced and replaces the oldest past referenced page whereas optimal looks at the future and replaces the page which is furthest to use.

 

Please guide me if this answer is correct or not.

 

Zulfi.

Edited by zak100
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.