why page table size is not determined not by multiplying with number of pages with page size?

98 Views Asked by At

Page table size is determined by multiplying number of pages with page table entry size and why not by multiplying with number of pages with page size

1

There are 1 best solutions below

0
Hari Krishnan On

You might be confused about what is a page and what is a frame(memory division done in main memory). Hope an example will be helpful for you to understand.

Lets say you have a process having size 1KB and your main memory size is 1MB. To place your process into main memory, you need to classify the process into page so that each page in the process will be placed in a frame in the main memory [So page size == frame size]

Let your page size = frame size = 32B = 25B

Then the total number of pages in the process is 1KB/32B = (210B) / 25B

which is 25

And the total number of frames in the main memory is 1MB/32B = (220B) / 25B

which is 215

Now we need to place the 25 process pages in 215 memory frames. Page table will help us here.

Page table will have 25 entries (representing each page), and each of that entry will be filled with the frame number where the corresponding page will be located.

Since we have 215 frames in main memory, we need 15 bits to represent a frame number.

So the total page size will be

25 * 15 = 480Bytes

Additional Notes

Note 1 : In the framed example since we got page table size greater than a page size ,we need to use multi level paging

Note 2: In real life scenario, The page table size might not be simply 15 bits. Instead some additional information will be provided for each of the page table entry.