1

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 (?)".

0

2 Answers 2

4

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.

6
  • hmmm, what exactly do you mean by "slowing the whole operation down"? I can't really get this part
    – 842Mono
    Jun 28, 2014 at 16:17
  • @MinaMichael I believe I answered that already in my edit.
    – guntbert
    Jun 28, 2014 at 16:21
  • oh okay I didn't see the edit. Thanks :D
    – 842Mono
    Jun 29, 2014 at 5:36
  • @guntbert What operation is slowed down by providing more swap-space ?
    – An0n
    Mar 19, 2018 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, 2018 at 16:32
2

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?)

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .