An in-depth exploration of Linux process memory management on x86-64, covering virtual memory areas (VMAs), page tables, and address translation. Explains lazy allocation through page faults, copy-on-write mechanics in fork() and MAP_PRIVATE, and permission changes via mprotect. Details transparent huge pages (THP), dirty tracking with userfaultfd and PAGEMAP_SCAN, TLB invalidation costs, and Page Table Isolation (PTI) as Meltdown mitigation. Includes practical guidance on using /proc interfaces like maps, smaps, and pagemap to inspect memory state, plus common pitfalls with mmap, file mappings, and memory protection.

20m read timeFrom 0xkato.xyz
Post cover image
Table of contents
A Friendly Tour of Process Memory on LinuxA Friendly Tour of Process Memory on Linux

Sort: