'Paging Calculation in Operating System
An Operating System uses a paging system with 4Kbyte pages. A given process uses a virtual address space of 8G and is assigned 4G of physical memory. How many entries does its page table contain?
Solution 1:[1]
Its page table needs 8 GiB / 4 KiB = 8 * 1024 * 1024 * 1024 / 4 / 1024 = 2 * 1024 * 1024 = 2097152 entries.
In that case; because there's 8 GiB of virtual space and only 4 GiB of physical memory; at least half of the page table entries must refer to something that isn't a unique page of physical RAM (e.g. some page table entries say their page isn't present, or some page table entries refer to the same physical RAM so that that same data appears in the virtual address space multiple times, or a mixture of both).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brendan |
