1) Locality is a key principle in computer architecture and OS design, Explain t
ID: 3569555 • Letter: 1
Question
1) Locality is a key principle in computer architecture and OS design, Explain two different types of locality.
2) Explain the following in the context of memory management.
a. Internal fragmentation
b. External fragmentation
3) A process is given 3 physical frames to run. Given the following page reference sequence, count the number of the page faults AFTER the frame allocation is initially filled for each of the page replacement algorithm: Optimal, FIFO, LRU, and Clock. (Show your work)
2 5 2 3 5 4 2 5 1 2 3 2
Explanation / Answer
The other two answers as Paramesh did you can find them on
1) https://en.wikipedia.org/wiki/Locality_of_reference
2) http://everydaylife.globalpost.com/internal-external-memory-fragmentation-28851.html
But here is the hardest one:
3)Optimal
2 2 2 2 2 2 2 2 2 2 3 3 5
- 5 5 5 5 5 5 5 1 1 1 1 1
- - - 3 3 4 4 4 4 4 4 4 4
Total Page Faults: 4
FIFO page replacement. When need to replace a page, choose the first page brought in. So, if we have three physical page frames, here is what happens for the above sequence:
2 5 5 3 3 4 2 5 1 1 3 4 5
- 2 2 5 5 3 4 2 5 5 1 3 4
- - - 2 2 5 3 4 2 2 5 1 3
Total Page Hits: 3
Total Page Faults: 10
What is disadvantage of FIFO? May eject a heavily used page.
LRU - eject least recently used page.
2 5 2 3 5 4 2 5 1 2 3 4 5
- 2 5 2 3 5 4 2 5 1 2 3 4
- - - 5 2 3 5 4 2 5 1 2 3
Total Page Hits: 4
Total Page Faults: 9
Clock
2 2 2 2 2 4 4 4 1 1 1 1 5
- 5 5 5 5 5 2 2 2 2 2 4 4
- - - 3 3 3 3 5 5 5 3 3 3
Total Page Faults: 7
For optimal and clock I'm not 100% sure
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.