Comment

Comment by throwawaaarrgh

I'm sorry, but you don't understand swap. It's useful to retain all kinds of memory in different scenarios, like cache, or windows that haven't been accessed in a while. It can free up fast memory, reducing contention and speeding up the system. And you can control snappiness to decide what and when things get swapped.

Swap is also used by the system's hibernate function to store a copy of RAM to disk.

If you have 64GB of RAM and no combination of your apps, cache, etc will ever approach that, then probably nothing will ever swap. But for more limited systems or when running apps with higher memory pressure, swap does increase system performance.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton