Jump to content

Number of page faults

Featured Replies

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

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.