Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (15 points) A process references five pages, A, B, C, D, and E, in the follow

ID: 3767486 • Letter: 1

Question

1. (15 points) A process references five pages, A, B, C, D, and E, in the following order:

A;B;C;D;A;B;E;A;B; E;C;D

Assume that the replacement algorithm is optimal and find out the number of page faults occurring after the frame allocation is initially filled with an empty main memory with three page frames. How many page faults will occur if LRU was used? How many page faults will occur if first-in-first-out was used?

Optimal:

A

B

C

D

A

B

E

A

B

E

C

D

LRU:

A

B

C

D

A

B

E

A

B

E

C

D

FIFO:

A

B

C

D

A

B

E

A

B

E

C

D

A

B

C

D

A

B

E

A

B

E

C

D

Explanation / Answer

Given string is

A;B;C;D;A;B;E;A;B; E;C;D

Optimal:

A

B

C

D

A

B

E

A

B

E

C

D

A

A

A

A

A

A

A

A

A

A

C

D

B

B

B

B

B

B

B

B

B

B

B

C

D

D

E

E

E

E

E

E

E

The number of page faults occurring after the frame allocation in optimal is  7

LRU:

A

B

C

D

A

B

E

A

B

E

C

D

A

A

A

D

D

D

E

E

E

E

E

E

B

B

B

A

A

A

A

A

A

C

C

C

C

C

B

B

B

B

B

B

D

The number of page faults occurring after the frame allocation in LRU is 9

FIFO:

A

B

C

D

A

B

E

A

B

E

C

D

A

A

A

D

D

D

E

E

E

E

E

E

B

B

B

A

A

A

A

A

A

C

C

C

C

C

B

B

B

B

B

B

D

The number of page faults occurring after the frame allocation in FIFO is 9

A

B

C

D

A

B

E

A

B

E

C

D

A

A

A

A

A

A

A

A

A

A

C

D

B

B

B

B

B

B

B

B

B

B

B

C

D

D

E

E

E

E

E

E

E