With lazy freeing of anonymous pages through MADV_FREE, performance of the MySQL sysbench workload more than doubles on my quad-core system. Madvise with MADV_FREE is used by applications to tell the kernel that memory no longer contains useful data and can be reclaimed by the kernel if it is needed elsewhere. However, if the application puts new data in the page (dirty bit gets set by hardware), the kernel will not throw away the data. This makes applications that free() and then later on malloc() the same data again run a lot faster, since page faults are avoided. In low memory situations, the kernel still knows which pages to reclaim. "Doing it all in userspace" is not a good solution for this problem, because if the system needs the memory it is way cheaper to just throw away these freed pages than to do the disk IO of swapping them out and back in. Signed-off-by: Rik van Riel