Skip to content
Omnikalc

Page table size calculator

Enter the address width, the page size, the size of a page table entry and the TLB entries to get the number of pages, the flat table size, the levels needed and the TLB reach.

Updated on
Your inputs
bits

Value out of range

bytes

Value out of range

Value out of range

Results

Number of virtual pages (billions)

68.719

Size of a flat page table
549.8 GB
Levels needed for a multi-level table
4
Entries per page-sized table
512
Memory reached by the TLB
256 KB
Virtual address space
256.00 TB

The page table size calculator gives the number of virtual pages, the size of a flat page table, the levels of a multi-level table and the TLB reach from the address width, the page size and the entry size.

How the calculation works

  • Enter the virtual address width and pick the page size.
  • Enter the size of a page table entry and the TLB entries.
  • The calculator gives the pages, the flat table size, the levels, the entries per table, the TLB reach and the address space.

Example

A 48-bit address space with 4 KB pages has 36 bits of page number, so 68.719 billion pages. At 8 bytes per entry, a flat table would take 549.8 GB. Each 4 KB table holds 512 entries (9 bits), so 4 levels are needed. A TLB of 64 entries reaches 256 KB.

Why it matters

The calculator helps computer science students, kernel developers and performance engineers to understand why operating systems use trees of page tables and how page size affects memory use and TLB misses.

Good to know

In x86-64 with 4 KB pages, the four levels each decode 9 bits, and a fifth level extends the address to 57 bits. Using 2 MB pages removes one level and multiplies the TLB reach by 512, at the price of more internal waste and more complex memory management. Each level adds a memory access on a TLB miss, which is why caches of partial translations exist inside the processor. The numbers here count the tables of a fully populated space, and a real process uses far less. Page table entries also hold flags such as present, writable and accessed, within the 8 bytes. For a system with a 32-bit address and 4 KB pages, two levels of 10 bits are enough.

The average memory access time calculator includes the cost of misses, the cache hit ratio calculator describes caches, the hash collision calculator covers lookups and the roofline model calculator relates memory bandwidth to performance.

Frequently asked questions

Why do systems use multi-level page tables?

A flat table needs one entry for every virtual page, even for the huge unused parts of a 48-bit address space, which would take hundreds of gigabytes per process. A multi-level tree only allocates the tables that cover addresses in use, so a small process needs a few kilobytes of tables.

How are the levels counted?

The page offset takes log2(page size) bits, and the rest of the address is the virtual page number. Each table fits in one page and holds page size / entry size entries, so it resolves log2 of that many bits. The levels are the page number bits divided by the bits per level, rounded up.

What is the TLB reach?

The translation lookaside buffer caches recent translations. Its reach is the number of entries times the page size, the memory it can cover without a miss. Larger pages raise the reach, which is why huge pages help programs with big working sets.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.