When 1500 processes share memory, page tables can eat 878 GB

Page Table Memory Consumption

Page tables are usually under 1% of mapped memory, but that ratio breaks when many processes share the same pages. Fernando Simões traces the problem from Linus Torvalds' 2003 defense of tree page tables to real incidents: Andrea Arcangeli's 64 GiB x86 machines running out of lowmem, Khalid Aziz's 512 GB Oracle server crashing with 1500 clients on a 300 GB SGA, and Postgres and ClickHouse deployments where page tables ballooned to tens of GiB. Huge pages help but aren't free, and NUMA adds a new trade-off between remote table walks and replication.

In the worst case, where every process maps the whole SGA, PTEs alone would take 878 GB.
  1. sweetjuly

    relatedly, it is also worth considering that your VA allocation behavior can have significant impacts on your page table costs.

    Some programs like to, for example, map allocations at random VAs for security reasons. If you're only using a single page, this makes your worst case cost 1 page for actual data + 2-3 pages of tables (depending on your CPU architecture and address space size). If you do this very often, this can get very expensive in a hurry.

  2. hinkley

    Something that was true in 2003 can be not true in 2026 with absolutely no contradiction. It’s a problem I’ve had multiple times with people getting bristly assuming that a push to replace a broken but “working” subsystem with something new and better necessitates a confession of guilt by the people who wrote the original system.

    As problem domains scale up by orders of magnitude, as they have since Linus ranted on 2003, the correct solution changes. Sometimes several times. It was the right solution, but it might not be the right solution now, and both are correct.

  3. monocasa

    While this article correctly points out issues with tree based page tables, it fails to describe how the other option (a PowerPC style hashed page table) being considered by Torvalds, et al. is any better. And a cursory glance doesn't appear to support them being better under the cases described; each issue seems like it'd be the same or worse under hashed page tables.

    For one, the hash on PowerPC is over the virtual address and a VSID (virtual segment ID) which functionally gets used as an address space ID[0]. That means that hashed page tables also have separate entries for each process mapping the same physical page.

    Since the hashed page table is one (physically!) contiguous structure, that means that all of the same NUMA tradeoffs also apply to it as well.

    Because it's based on a hash of the virtual address, you have the same issues with partial residency bloat of the structure as you either have to size the whole page table up in powers of two during hash collisions[1], or you have to treat the whole thing like a large last chance TLB and have a separate software page table to hold your ground truth (which will probably just be a tree based table anyway).

    And on top of that, grabbing 8 spatially related PTEs at once rather than just 8 that happened to hash to the same thing also tends to reduce memory bandwidth rather than just latency for the same reasons that caching and prefetching works at all. There's a good chance the other seven PTEs are actually going to be n […]

More from this day

2026-10-04