arrow
arrow
arrow
For the following page reference string 4, 3, 2, 1, 4, 5, 4, 3, 2, 1, 5 the number of page faults that occur in Least Recently Used (LRU) page replace
Question



For the following page reference string 4, 3, 2, 1, 4, 5, 4, 3, 2, 1, 5 the number of page faults that occur in Least Recently Used (LRU) page replacement algorithm with frame size 3 is:

A.

6

B.

8

C.

10

D.

12

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.

Free Tests

Free
Must Attempt

Basics of Education: Pedagogy, Andragogy, and Hutagogy

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
Free
Must Attempt

UGC NET Paper 1 Mock Test 1

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

Basics of Education: Pedagogy, Andragogy, and Hutagogy

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
test-prime-package

Access ‘UGC NET Computer Science’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
368k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow