GATE CS 2023 (Forenoon) — Question 57

Operating Systems (OS)Memory Management and Virtual MemoryNAT2 marksHard

Consider the following two-dimensional array \(D\) in the C programming language, which is stored in row-major order:
c
1int D[128][128];
2
Demand paging is used for allocating memory and each physical page frame holds 512 elements of the array \(D\). The Least Recently Used (LRU) page-replacement policy is used by the operating system. A total of 30 physical page frames are allocated to a process which executes the following code snippet:
c
1for (int i = 0; i < 128; i++)
2    for (int j = 0; j < 128; j++)
3        D[j][i] *= 10;
4
The number of page faults generated during the execution of this code snippet is ________.
Practise the full 2023-FN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkOperating System Concepts (Galvin)Scheduling, synchronisation, deadlocks, memory and file systems.
Practise more on Memory Management and Virtual MemoryTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group