Free Memory management lessonsMemory management · Stage 1 · Paging · Step 2
How big is a page table?
Calculate the memory a page table takes, and see how page size trades table size against waste. About 12 minutes.
A 32-bit address space with 4 KB pages and 4-byte entries needs a page table of:
- A4 MB
- B4 KB
- C4 GB
Show the answer
4 MB. 2^20 entries × 4 bytes = 4 MB.
Page table size
A process has an address space of 2 to the power addressBits bytes, divided into pages of pageSizeBytes bytes (a power of two), and each page table entry takes entryBytes bytes. Return the size of a single-level page table in bytes.
addressBits = 32, pageSizeBytes = 4096, entryBytes = 4 → 4194304
10 ≤ addressBits ≤ 40 · pageSizeBytes a power of two, at most 2^addressBits · 1 ≤ entryBytes ≤ 16
Solve it in your browserFree account, no card. Python, C++, Java or JavaScript, with hints if you get stuck, and your progress is saved.
Sign up free to solve