GATE CS 2023 | Question 57

Operating Systems › Memory Management · NAT · 2 marks · Answer: 4096

  1. Question 57Operating Systemsnat2 marks
    int D[128][128] is row-major; each frame holds 512 elements; 30 frames; LRU. The code does for i: for j: D[j][i]*=10 (column-major access). The number of page faults is __________

    Answer: 4096

    Solution

    Answer: 4096 has elements, per frame, so pages; each page holds 4 full rows (since a row is 128 elements, rows per page). The access pattern D[j][i] sweeps a whole column (all 128 rows) for each , touching all 32 pages each time. With only 30 frames (LRU), every access to a page that was evicted faults. The total works out to page faults.

More GATE PYQ on Memory Management

All GATE CS Operating Systems PYQ →

Attempt GATE CS 2023 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →