Correct option is C
Given:
1.
Page Reference String: 4, 3, 2, 1, 4, 5, 4, 3, 2, 1, 5
2.
Frame Size: 3
3.
Algorithm:
Least Recently Used (LRU)
We need to calculate the number of
page faults.
Step 1: Understanding LRU Algorithm
· The
LRU page replacement algorithm replaces the page that has
not been used for the longest time in memory.
· Initially, the memory frames are empty.
· As pages are referenced:
· If the page is not in memory, a
page fault occurs.
· If the memory is full, the
least recently used page is replaced.
Step 2: Simulate the Page Reference String Initial Memory State: Empty
Step 3: Count Page Faults
Total Page Faults: 10
Information Booster
1.
LRU Characteristics:
· Tracks usage history of pages to identify the least recently used page.
· Requires additional data structures like stacks or counters for implementation.
2.
Page Replacement Algorithms:
·
FIFO (First-In-First-Out): Replaces the oldest page.
·
Optimal: Replaces the page that will not be used for the longest period in the future.
·
LRU: Replaces the page least recently used.
Additional Knowledge
·
Page Faults: Occur when a required page is not present in memory.
·
Frame Size Impact: Larger frame sizes generally reduce page faults but increase memory usage.
·
Real-World Usage: LRU is commonly used in operating systems for efficient memory management.