Apparently increasing the size of the swap should make my computer able to handle more applications because it can "push more data aside" into the swap.

...or will it make the computer hang more because it's putting everything in swap? So this means that it shouldn't be too big or too small?

In short; which is correct?;

  • The bigger the swap the better.

  • Swap should be balanced according to "something (?)".

  • Why you make that conclussion ? – An0n Mar 19 '18 at 23:25

Not really. The only thing (memorywise) that improves performance is more RAM.

Remember that the slowest part of memory is your Hard-disk - swap just provides the ability to use more memory by swapping some pages out to the disk, which is slow compared to RAM operations.

What you gain by providing more swap-space is the ability to run more/bigger programs, respectively programs with bigger memory requirements - at the cost of slowing the whole operation down.

As to the question of balancing: regard swap as last measure, used when everything else fails and the kernel would have to resort to killing a process because there no more memory available (OOM=Out of Memory). So keeping some swap is good.

An additional factor comes into play when you are using suspend to RAM (aka hibernating) - in that case you should provide the same amount that you have as RAM and maybe a little bit extra.

  • hmmm, what exactly do you mean by "slowing the whole operation down"? I can't really get this part – Mina Michael Jun 28 '14 at 16:17
  • @MinaMichael I believe I answered that already in my edit. – guntbert Jun 28 '14 at 16:21
  • oh okay I didn't see the edit. Thanks :D – Mina Michael Jun 29 '14 at 5:36
  • @guntbert What operation is slowed down by providing more swap-space ? – An0n Mar 19 '18 at 23:20
  • @An0n the slow down doesn't come from providing more swap but from **using ** swap when the system is low on RAM. – guntbert Mar 20 '18 at 16:32

Increasing swap size wouldn't increase performance unless you have already pushed your computer to the limit (full memory, full swap). The system doesn't decide when to use swap based on swap size, but based on the "swappiness" parameter (see How do I configure swappiness?)

  • okay. I do know about swappiness. So in the end the bigger the swap the better, right? – Mina Michael Jun 28 '14 at 16:07
  • @MinaMichael Let's say that bigger swap won't do any damage – Emil Jun 28 '14 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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