GateAI
Memory Management and Virtual Memory

GATE CSE 2021 Set 2 · Q48

NAT2 marksMedium

Time

Consider a three-level page table to translate a 39-bit virtual address to a physical address as shown below. The page size is 4KB (1KB = 2102^{10} bytes) and page table entry size at every level is 8 bytes. A process PP is currently using 2GB (1GB = 2302^{30} bytes) virtual memory which is mapped to 2GB of physical memory. The minimum amount of memory required for the page table of PP across all levels is ________ KB.

GATE CSE 2021 Set 2 Q48 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 4108

Memory Management and Virtual Memory

To find the minimum memory required for the page tables across all levels, we assume that the process's 2GB virtual memory is allocated contiguously.

  1. Basic Parameters:

    • Page Size =4 KB=212 bytes= 4\text{ KB} = 2^{12}\text{ bytes}

    • Page Table Entry (PTE) size =8 bytes=23 bytes= 8\text{ bytes} = 2^3\text{ bytes}

    • Entries per page table page =4 KB8 B=29=512 entries= \frac{4\text{ KB}}{8\text{ B}} = 2^9 = 512\text{ entries}

    • Each page table page at any level takes 4 KB4\text{ KB} of memory.

  2. Number of Pages Required by Process PP:

    • Process virtual memory size =2 GB=231 bytes= 2\text{ GB} = 2^{31}\text{ bytes}

    • Total number of pages =231 bytes212 bytes=219 pages= \frac{2^{31}\text{ bytes}}{2^{12}\text{ bytes}} = 2^{19}\text{ pages}

  3. Page Table Hierarchy Calculations:

    • Level 3 Page Tables: Each Level 3 table can map 29=5122^9 = 512 pages.

      Number of Level 3 tables=⌈21929⌉=210=1024 tables\text{Number of Level 3 tables} = \left\lceil \frac{2^{19}}{2^9} \right\rceil = 2^{10} = 1024\text{ tables}
    • Level 2 Page Tables: Each Level 2 table can point to 29=5122^9 = 512 Level 3 tables.

      Number of Level 2 tables=⌈1024512⌉=⌈21029⌉=2 tables\text{Number of Level 2 tables} = \left\lceil \frac{1024}{512} \right\rceil = \left\lceil \frac{2^{10}}{2^9} \right\rceil = 2\text{ tables}
    • Level 1 Page Table (Root): There is always 11 root page table at Level 1, which points to the Level 2 tables.

      Number of Level 1 tables=1 table\text{Number of Level 1 tables} = 1\text{ table}
  4. Total Memory Required:

    • Total page table pages =1024+2+1=1027 pages= 1024 + 2 + 1 = 1027\text{ pages}

    • Total memory =1027×4 KB=4108 KB= 1027 \times 4\text{ KB} = 4108\text{ KB}

Thus, the minimum amount of memory required is 4108 KB.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Memory Management and Virtual Memory previous year question is Q48 of the GATE CSE 2021 Set 2 paper. Find more GATE CSE PYQs on Memory Management and Virtual Memory in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Memory Management and Virtual Memory PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Memory Management and Virtual Memory in GATE CSE

Memory Management and Virtual Memory has 32 GATE CSE PYQs across 22 papers from 2011 to 2026. 15 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2021 Set 2.

How GATE tests Memory Management and Virtual Memory

More from GATE CSE 2021 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2021 Set 2 · Q48 · NAT

Consider a three-level page table to translate a 39-bit virtual address to a physical address as shown below. The page size is 4KB (1KB = 210 bytes) and page table entry size at every level is 8 bytes. A process P is currently using 2GB (1GB = 230 bytes) virtual memory which is mapped to 2GB of physical memory. The minimum amount of memory required for the page table of P across all levels is … KB.

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.