- small size: less wasted space due to internal fragmentation; fewer unused pages in memory.
- large page size: more efficient disk I/O, smaller page tables
Average # pages per process segment is s/p. Each page requires 'e' bytes of page table, so each process segment requires page table size of es/p bytes.
Total overhead per segment, therefore, due to internal fragmentation and page table entries, is
se/p + p/2To minimise the overhead, differentiate with respect to page size, p, and equate to 0:
-se/p2 + ½ = 0So for example, if the average segment size were 256K, and the page table entry size were 8 bytes, the optimum page size, to minimise overhead due to page table entries and internal fragmentation, would be sqrt(2 × 256K × 8) = 2048 = 2K. Note that this calculation ignores the need to keep page sizes large in order to speed up paging operations; it only considers memory overheads.
=> p = sqrt(2se)
In other words