The GATE Grind

GATE 2021 CS (CS2) – Question 58

Operating System · Memory Management and Virtual Memory · 2 marks · Numerical answer

A three-level page table translates 39-bit virtual addresses with fields: level-1 index 9 bits, level-2 index 9, level-3 index 9, page offset 12. Pages are 4 KB and every PTE is 8 bytes. A process uses 2 GB of virtual memory mapped to 2 GB physical memory. Find the minimum total page-table memory across all levels, in KB.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 4108 to 4108

Explanation

Two GB is 2³¹ bytes, hence 2³¹/2¹²=2¹⁹ mapped pages. Each leaf page-table block holds 4096/8=512=2⁹ entries, so 2¹⁰=1024 leaf blocks are needed. They require two level-two blocks, plus one root block. Total (1024+2+1)×4 KB=4108 KB. Contiguous aligned virtual allocation attains this minimum.

More Memory Management and Virtual Memory questions

All Memory Management and Virtual Memory questions →