Size of page table - Example - Operating System

Q.  A machine has a physical memory of 64 Mbyte and a virtual address space of 32 - bit. The page size is 4kbyte, What is the approximate size of the page table?

- Published on 26 Aug 15

a. 24 Mbyte
b. 16 Mbyte
c. 2 Mbyte
d. 8 Mbyte

ANSWER: 2 Mbyte
 

    Discussion

  • Nirja Shah   -Posted on 21 Nov 15
    - A page entry is used to get the address of physical memory.

    - At this stage it can be assumed that single level of Paging is happening.

    - Hence, the resulting page table will contain entries for all the pages of the Virtual address space.

    Number of entries in page table = (virtual address space size)/(page size)

    - By using the above formula we can say that there will be 2∧(32-12) = 2∧20 entries in page table.

    - The no. of bits required to address the 64MB Physical memory = 26.

    - So there will be 2∧(26-12) = 2∧14 page frames in the physical memory.

    - The page table needs to store the address of all these 2∧14 page frames.

    - Therefore, each page table entry will contain 14 bits address of the page frame and 1 bit for valid-invalid bit. Since memory is byte addressable.

    - So we take that each page table entry is 16 bits i.e. 2 bytes long.

    Size of page table = (total number of page table entries) *(size of a page table entry)
    = (2∧20 *2) = 2MB

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)