Purgeable Memory Allocations for Linux

1 · Christopher Wellons · Dec. 29, 2019, 1:16 a.m.
I saw (part of) a video, OS hacking: Purgeable memory, by Andreas Kling who’s writing an operating system called Serenity and recording videos his progress. In the video he implements purgeable memory as found on some Apple platforms by adding special support in the kernel. A process tells the kernel that a particular range of memory isn’t important, and so the kernel can reclaim if it the system is under memory pressure — the memory is purgeable. Linux has a mechanism like this, madvise(2), tha...