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

One of my Ubuntu servers' swap partition is full. What are the dangers and/or performance ramifications of this situation?

share|improve this question
up vote 3 down vote accepted

Swap basically serves two roles - firstly to move out less used 'pages' out of memory into storage so memory can be used more efficiently. Secondly if memory is insufficient, it acts to 'add' memory.

If its the former case, its ok. With the latter case, there's two possible scenarios. Firstly, you'd have increased disk use. If your disks arn't fast enough to keep up, then your system might end up thrashing, and you'd experience slowdowns as data is swapped in and out of memory. This would result in a bottleneck.

The second possibility is you might run out of memory, resulting in wierdness and crashes.

There's a few ways to work around this. Firstly, more swap. One option might be to increase the size of your swap partition when you next do maintainance, or to switch over to a swap file. Both these approaches are bandaiding the main issue, but should tide you over for the short run.

The real solution is to add more memory. There's no substitute for ---real butter--- ram, and if you have enough memory, you'll swap less.

If you for some reason still are swapping heavily despite maxing out your memory, consider using faster storage for swap - an SSD might be an option thats faster than having swap on a spinning drive. This will likely end up in a faster system than using a spinning drive, and with a large enough SSD, with a larger amount of spare space set you can maximize the lifespan of the drive and improve performance constancy, at the expense of some space. Its a throwback but having a seperate swap drive might be an option here.

If you want to do it right you might also want to work out what is using up that much ram, and why. Htop is a good start, and there's an entire question on that, then attempt to tune the program as needed. This is of course dependent on overall performance and other requirements and may be specific to the program, and what its used for

share|improve this answer
Done. Might want to delete that ;) – Journeyman Geek Aug 8 '13 at 7:34

The danger is the rather ominous sounding OOM Killer.

share|improve this answer

I am not sure what you mean by full, but I assume that it is in use all the time. If your system is using swap a lot, it will affect performance of the system overall as traditional drives are much slower than RAM. You either need to configure and adjust some of your applications to use less resources, or add more RAM.

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.