The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+14 votes
875 views

A system uses $3$ page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below? 

$\text{4, 7, 6, 1, 7, 6, 1, 2, 7, 2}$

asked in Operating System by Veteran (106k points)
edited by | 875 views

3 Answers

+14 votes
Best answer

Total page faults $=6.$

$\small\begin{array}{|c|c|c|c|} \hline \quad\bf{4}\quad& \quad\bf{7} \quad& \quad \bf{6}\quad & \quad\bf{1}\quad&\quad\bf{7}\quad&\quad \bf{6}\quad &\quad \bf{1}\quad &\quad \bf{2}\quad &\quad \bf{7}\quad &\quad \bf{2}\quad \\ \hline & & \underset{\boxed{F}}6&6&6&6&6&6&\underset{\boxed{F}}7&7\\ \hline \hline &\underset{\boxed{F}}7 &7 &7&7&7&7&\underset{\boxed{F}}2&2&2\\ \hline
\hline \underset{\boxed{F}}{4}&4 & 4&\underset{\boxed{F}}1&1&1&1&1&1&1\\ \hline
  \end{array} \implies 6\text{ faults}$

 

Another way of answering the same.

$\require{cancel} \begin{array}{|c|}\hline
\quad6\quad \\\hline 7\\\hline\quad\cancel {4} \quad 1\\ \hline
\end{array}$ $\require{cancel} \begin{array}{|c|}\hline
\quad6\quad \\\hline \cancel{7}{2}\\\hline 1\\ \hline
\end{array}$ $\require{cancel} \begin{array}{|c|}\hline
\quad\cancel {6}{7}\quad \\\hline{2}\\\hline1\\ \hline
\end{array}$$\require{cancel} \begin{array}{|c|}\hline
\quad7\quad \\\hline {2}\\\hline 1\\ \hline
\end{array}$ $\implies 3 \text{ faults}+3 \text{ initial access faults} = 6 \text{ page faults}$

OR

$\require{cancel} \begin{array}{|c|}\hline
\quad\cancel6 7\quad \\\hline\cancel {7}2\\\hline\cancel 4 1\\ \hline
\end{array} \implies 3 \text{ faults}+3 \text{ initial access faults} = 6 \text{ page faults}$

answered by Boss (22.4k points)
edited by
+4 votes
total : 6
answered by Active (1.3k points)
+2 votes

answer will be 6 page fault

answered by Boss (20.6k points)
0
Image is wrong . Answer is 6
0
as i have missed the hit by myself  as i have use shortcut while answering .... :)
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,598 questions
48,599 answers
155,642 comments
63,709 users