Memory & Virtual Memory
Explain how Linux gives each process a private virtual address space, and interpret memory usage, paging and OOM events on a live system.
4 objectives 6 steps about 130 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Translate a virtual address to a physical one through page tables and explain the roles of the TLB and page faults.
- Explain demand paging, copy-on-write, memory-mapped files, the page cache, reclaim and swapping.
- Interpret RSS, PSS, VSZ, free versus available memory, major and minor faults, and /proc/<pid>/smaps for a running process.
- Explain overcommit and the OOM killer, and set memory limits that stop one service from exhausting a host.
Lesson plan
6 steps, about 130 min · 0 of 5 lessons available so far
- One address space per process: virtual addresses, pages and frames Concept · 20 min · coming later
- Worked example: walking a multi-level page table and why the TLB matters Worked example · 25 min · coming later
- Lazy by design: demand paging, copy-on-write, mmap and the page cache Concept · 20 min · coming later
- When memory runs out: reclaim, swap, page replacement and the OOM killer Concept · 20 min · coming later
- Lab: page faults, mmap, smaps and a memory limit that triggers the OOM killer Lab · 30 min · coming later
- Check: explain a memory report and an OOM entry in the kernel log Knowledge check · 8 questions
Practise it
Write a program that allocates and touches memory in steps; run it with systemd-run under a MemoryMax limit, record RSS, major and minor faults and the OOM kill from the journal, and explain each number in a short report.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Memory AllocatorIntermediate · 6–12 h
- Build your own Operating SystemAdvanced · 40–80 h
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.