Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get alert emails whenever swap usage is at 100%. In my case, swap usage doesn't reduce later on (even though memory is free) so I get an alert email every hour.

How can I reduce swap usage without rebooting my Linux server?

share|improve this question
If your swap is regularly filling up, then you need to increase the amount of RAM in your server. – EEAA Jan 27 '12 at 14:30
I'd rather know what process is using the swap rather than throwing more ram at it, e.g. run top(press Op). – Mark Jan 27 '12 at 18:15
What is your swappiness set to? cat /proc/sys/vm/swappiness A high swappiness and small swap file means it will be full often. Reduce swappiness or increase the size of the swap file, or both. – Brian Sep 17 '14 at 19:27

You can run swapoff -a as root to swap all memory back in. Don't forget to run swapon -a afterwards to make swap available again. Note that swapoff will fail if there is not enough physical memory available to swap everything back in.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.