Virtual memory explained as a dialogue between a process and the Linux kernel
The article explores virtual memory in Linux through a dialogue between a process named Alloca and the kernel, explaining how memory management impacts system performance. It covers core concepts such as page tables, TLBs, demand paging, and memory isolation in a narrative format. The piece serves as an in-depth guide for understanding and optimizing memory usage in data-intensive applications.
- ▪Virtual memory provides process isolation, memory protection, and the illusion of abundant memory for each process.
- ▪The article uses a dialogue format between a process and the Linux kernel to explain complex memory management concepts incrementally.
- ▪Key mechanisms covered include demand paging, copy-on-write, memory-mapped I/O, page reclaim, and performance effects from TLBs and NUMA topology.
- ▪Address translation relies on hierarchical page tables and hardware components like the MMU and TLB to map virtual addresses to physical memory.
- ▪The article includes practical observability techniques for monitoring VMAs, page faults, RSS/PSS, and NUMA placement on Linux systems.
Opening excerpt (first ~120 words) tap to expand
Virtual Memory: A Deep Dive into Page Tables, TLBs, and Linux InternalsFrom page faults to NUMA topology: how the Linux kernel manages memory, and what that means for the performance of data-intensive systems.Abhinav UpadhyayMay 10, 202653112ShareA quick note before we begin: I’ve been absent here for a while. Life happened, and I had to step away from publishing for longer than I expected.This article is my way of getting back into rhythm. It is much larger than my usual pieces: roughly 25,000 words, compared to the 4,000–6,000 words I normally publish.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Hacker News (Newest).