這個系列會從 userspace 看到的記憶體現象一路追到 Linux kernel 的設計:虛擬記憶體、page table、page fault、COW、buddy/slab allocator、page cache、swap、memory reclaim、cgroup 與 OOM。目標是建立一套能用在 production debugging 的 Linux memory mental model。
在使用者空間呼叫 malloc() 成功時,我們通常會說「配置到記憶體了」。但這句話很容易讓人誤以為 kernel 已經立刻找好實體 page,並把 RAM 交...