[Verse 1] When RAM gets scarce and pages pile high The kernel panics, resources run dry First comes kswapd, the daemon that sweeps Scanning for victims while the system still breathes Anonymous pages get pushed to swap space While file-backed memory finds its rightful place [Chorus] Pressure mounts, reclaim begins LRU decides which page wins Least recently used gets the boot OOM killer draws, ready to shoot Free up memory, keep the machine alive Watermarks falling, systems must survive [Verse 2] Direct reclaim kicks when allocation fails Process blocks waiting while the scanner prevails Dirty pages flushed back to storage below Clean pages discarded, nowhere left to go Page cache shrinking under memory strain Trading performance for stability's gain [Chorus] Pressure mounts, reclaim begins LRU decides which page wins Least recently used gets the boot OOM killer draws, ready to shoot Free up memory, keep the machine alive Watermarks falling, systems must survive [Bridge] When reclaim can't cope and pages won't budge OOM assassin becomes the final judge Badness scores calculated, victims ranked high Memory hogs and fork bombs prepare to die Sacrificial processes meet their doom Trading lives to make some breathing room [Verse 3] Three watermarks guard our precious RAM High, low, and minimum, each serves the plan Above high water, all systems are green Below minimum threshold, chaos foreseen Between these markers, kswapd awakens Background reclaim before crisis overtaken [Chorus] Pressure mounts, reclaim begins LRU decides which page wins Least recently used gets the boot OOM killer draws, ready to shoot Free up memory, keep the machine alive Watermarks falling, systems must survive [Outro] Zone reclaim balances NUMA nodes apart Memory compaction plays its crucial part Defragmenting pages, coalescing space So allocations find their proper place
← Page Cache & Buffer Management | I/O Scheduler Fundamentals →