Skip to content
Official PYQ · 1995

GATE CS 1995 Q2.7 — Memory Management and Virtual Memory

Explain with AI

The address sequence generated by tracing a particular program executing in a pure demand based paging system with 100100 records per page with 11 free main memory frame is recorded as follows. What is the number of page faults?

0100,0200,0430,0499,0510,0530,0560,0120,0220,0240,0260,0320,03700100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0370

Choose one option
View worked solution

Answer: C

Since each page contains 100100 records, the page number for any given address AA can be determined as ⌊A/100⌋\lfloor A / 100 \rfloor.

Let's map the given address sequence to its corresponding page numbers:

  • 0100→⌊100/100⌋=10100 \rightarrow \lfloor 100/100 \rfloor = 1
  • 0200→⌊200/100⌋=20200 \rightarrow \lfloor 200/100 \rfloor = 2
  • 0430→⌊430/100⌋=40430 \rightarrow \lfloor 430/100 \rfloor = 4
  • 0499→⌊499/100⌋=40499 \rightarrow \lfloor 499/100 \rfloor = 4
  • 0510→⌊510/100⌋=50510 \rightarrow \lfloor 510/100 \rfloor = 5
  • 0530→⌊530/100⌋=50530 \rightarrow \lfloor 530/100 \rfloor = 5
  • 0560→⌊560/100⌋=50560 \rightarrow \lfloor 560/100 \rfloor = 5
  • 0120→⌊120/100⌋=10120 \rightarrow \lfloor 120/100 \rfloor = 1
  • 0220→⌊220/100⌋=20220 \rightarrow \lfloor 220/100 \rfloor = 2
  • 0240→⌊240/100⌋=20240 \rightarrow \lfloor 240/100 \rfloor = 2
  • 0260→⌊260/100⌋=20260 \rightarrow \lfloor 260/100 \rfloor = 2
  • 0320→⌊320/100⌋=30320 \rightarrow \lfloor 320/100 \rfloor = 3
  • 0370→⌊370/100⌋=30370 \rightarrow \lfloor 370/100 \rfloor = 3

The resulting page reference string is:
1,2,4,4,5,5,5,1,2,2,2,3,31, 2, 4, 4, 5, 5, 5, 1, 2, 2, 2, 3, 3

With only 11 free main memory frame, a page fault occurs every time a referenced page is different from the page currently residing in the frame:

  1. Reference 11 →\rightarrow Fault (Frame: [1][1])
  2. Reference 22 →\rightarrow Fault (Frame: [2][2])
  3. Reference 44 →\rightarrow Fault (Frame: [4][4])
  4. Reference 44 →\rightarrow Hit (Frame: [4][4])
  5. Reference 55 →\rightarrow Fault (Frame: [5][5])
  6. Reference 55 →\rightarrow Hit (Frame: [5][5])
  7. Reference 55 →\rightarrow Hit (Frame: [5][5])
  8. Reference 11 →\rightarrow Fault (Frame: [1][1])
  9. Reference 22 →\rightarrow Fault (Frame: [2][2])
  10. Reference 22 →\rightarrow Hit (Frame: [2][2])
  11. Reference 22 →\rightarrow Hit (Frame: [2][2])
  12. Reference 33 →\rightarrow Fault (Frame: [3][3])
  13. Reference 33 →\rightarrow Hit (Frame: [3][3])

Counting the page faults, we get a total of 77 page faults.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Management and Virtual Memory questions