🐧 Linux Systems Programming
Tutorial Prerequisites GitHub ↗
Home / Memory
Part 4 3 chapters

Memory

Virtual address spaces, mmap and shared mappings, and what glibc malloc, Rust allocators, and the Go GC actually do — with shmkv, a cross-language mmap-backed key-value store.

Chapter 15

Virtual memory

The address space read line by line from /proc/self/maps, brk versus mmap in each language's allocator under strace, minor and major page faults measured with getrusage and perf, RSS versus VSZ versus PSS from a live smaps_rollup, overcommit and OOM-killer policy, and a tour of madvise — with memmap, a self-inspecting memory tool in all three languages.

45 minutesRead →
Chapter 16

mmap and shared mappings

File-backed vs anonymous and MAP_SHARED vs MAP_PRIVATE copy-on-write, msync guarantees against page-cache writeback, the ftruncate+mmap lifecycle, and memfd sealing — proven by shmkv v0, one byte-exact store format that the C++, Go, and Rust binaries create, write, and read interchangeably.

50 minutesRead →
Chapter 17

Allocators and GC runtimes

What actually happens between your allocation and the kernel's pages: glibc malloc's arenas and tcache, what pmr and bumpalo really change, sync.Pool as Go's arena substitute, and the Go GC's pacer driven live with GOGC and GOMEMLIMIT — cross-checked with massif, /usr/bin/time, ltrace, and pprof.

50 minutesRead →
← Previous part Processes, Signals, Privilege Next part → IPC

Linux Systems Programming

A chaptered guide to Linux systems programming in modern C++, Go, and Rust — processes, I/O, memory, IPC, networking, concurrency, debugging, containers, and observability, with runnable examples in all three languages.

Tutorial

  • Outline
  • Prerequisites
  • Lab setup
  • Roadmap

Reference

  • Linux man pages ↗
  • Linux performance (Gregg) ↗
  • View on GitHub ↗
  • Issues ↗
Open source · Apache 2.0 Last built 2026-10-11