title: How does multi-level page table save memory space?
body: <p>I am trying to understand how multi-level page table saves memory. As per my understanding, Multi-level page table in total consumes more memory than single-level page table. </p>
  
  <p>Example : Consider a memory system with page size 64KB and 32-bit processor. Each entry in the page table is 4 Bytes. </p>
  
  <p><strong>Single-level Page Table</strong> : 16 (2^16 = 64KB) bits are required to represent page offset. So rest 16-bits are used to index into page table. So </p>
  
  <p><strong>*Size of page table = 2^16(# of pages) * 4 Bytes(Size of each page table entry) = 2^18 Bytes*</strong></p>
  
  <p><strong>Multi-level Page Table</strong> : In case of two-level page table, lets use first 10-most significant bits to index into first level page table. Next 10-bits to index into second level page table, which has the page number to frame number mappings. Rest 12-bits represents the page offset. </p>
  
  <p>Size of a second-level page table = 2^10 (# of entries) * 4 bytes(size of each entry) = 4 KB</p>
  
  <p>Total size of all the second-level page tables = 2^10 (# of second-level page tables) * 4KB (Size of each second-level page table) = 4 MB</p>
  
  <p>Size of first-level page table = 2^10(# of entries) * (10/8) Bytes (Size of each entry) = 1.25 KB</p>
  
  <p><strong><em>Total memory required to store first and second level page tables = 4 MB + 1.25 KB</em></strong> </p>
  
  <p><strong><em>So we need more memory to store multi-level page tables.</em></strong> </p>
  
  <p>If this is the case, How does multi-level page tables save memory space ?</p>