0

I have a laptop with extremely slow HDD. Everything runs great on it except when I use up all the RAM and the system starts to utilize SWAP.

Would turning of SWAP hinder or improve performance. Or is there a setting to force the system to use SWAP more conservatively.

My laptop runs Linux 17.10 with 8GB of RAM and 5400RPM HDD and i7 processor.

magasr
  • 103
  • 6

1 Answers1

3

You can play with your machine's swappiness setting and configure a lower value like 10 instead of the default 60. See How do I configure swappiness? for how to change it.

The swappiness determines the balance between avoiding swap and preferring to keep free memory for caches and stuff. Lower values mean less/later swap usage.

I would not completely disable swap though, because if you then run out of memory, even just a tiny bit and very briefly, the OOM-Killer (Out Of Memory) will kick in and start randomly terminating processes until enough RAM is available again. You normally want at least a little buffer there. Doesn't have to be 8GB, maybe just 2GB, but nothing isn't the best option usually.

Byte Commander
  • 107,489