CS FundamentalsHardGATE CS

A 32-bit machine uses two-level paging with 4 KB pages and 4-byte entries (10+10+12 split). A process has 6 MB of code and data starting at address 0, a 5 MB heap starting at 0x40000000 and a 3 MB stack ending at the top of the address space. Every page table is allocated only when needed. What is the total memory used by page tables (top level included)?

  1. A. 20 KB
  2. B. 28 KB
  3. C. 24 KB
  4. D. 32 KB

Correct answer: C. 24 KB

Each second-level table maps 4 MB. 6 MB at 0 needs 2 tables, the 5 MB heap on a 4 MB boundary needs 2, the 3 MB stack lies inside the last 4 MB region and needs 1: 5 second-level tables plus the top-level table = 6 pages = 24 KB.

More Operating Systems questions

Exams that ask this topic