GATE CS 2024 Set 2 — Question 64
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+2 / -0HardMultilevel & Inverted Page TablesMemory ManagementOperating SystemDemand Paging
Operating System → Memory Management → Demand Paging
Last updated
Question
Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = bytes. The OS uses a 2-level page table for memory management, with the page table containing an outer page directory and an inner page table. The OS allocates a page for the outer page directory upon process creation. The OS uses demand paging when allocating memory for the inner page table, i.e., a page of the inner page table is allocated only if it contains at least one valid page table entry.An active process in this system accesses 2000 unique pages during its execution, and none of the pages are swapped out to disk. After it completes the page accesses, let denote the minimum and denote the maximum number of pages across the two levels of the page table of the process.The value of is ________
Correct answer
1028 to 1028
Solution
1.System Parameters:
- Logical Address (LA) space = 32 bits.
- Page Size (PS) = 4 KB = bytes.
- Page Table Entry (PTE) size = 4 bytes.
- Number of entries per page = entries.
- Total pages in LA space = pages.
- The Inner Page Table (IPT) needs to map pages. Since each IPT page holds 1024 entries, the total number of IPT pages is pages.
- The Outer Page Directory (OPD) must have one entry for each of the 1024 IPT pages. Thus, the OPD has 1024 entries.
- Size of OPD = bytes = 4 KB, which fits exactly in 1 page.
- 1 page is always allocated for the OPD upon process creation.
- To minimize the number of IPT pages for 2000 unique pages, we assume they are contiguous in the logical address space.
- Number of IPT pages = pages.
- .
- 1 page is always allocated for the OPD.
- To maximize the number of IPT pages, we spread the 2000 unique pages across as many IPT pages as possible.
- Since there are only 1024 IPT pages in total, and the process accesses unique pages (where ), it is possible to have at least one entry in every single IPT page.
- .
- .
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Memory Management
2026 Set 2 Q23Which one of the following CPU scheduling algorithms cannot be preemptive?2026 Set 1 Q29With respect to deadlocks in an operating system, which of the following statements is/are FALSE?2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 1 Q35Consider a system consisting of instances of a resource , being shared by 5 processes.…2026 Set 2 Q51Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A…