Is swap necessary for 16GB ram, i7-13th gen intel core laptop?

I was wondering if it is possible to not have a swap for my laptop, since I think my laptop has powerful specs already. However I have faced long periods of time when nixos compiles Hyprland and other Qt stuff. However, using btop on another tty, I see the maximum ram usage comes out to be close to 10 GB of ram.

Enabling swap is a bit of an opinionated topic when having enough ram for common workloads i think. I personally have zramSwap enabled as it is preferable to a hard OOM and had been running without swap for about 6 months with one instance of OOM (i got 32GB) which was caused by running a VM and compiling a larger package before, so YMMV depending on what you plan to do with it (E.g. my T400 is fine with just 8GB of ram and the highest usage was 5GB due to MatLab).

Required reading on this topic:

3 Likes