Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Why should the size of the swap partition be double of the RAM size?

Does the rule of 1.5 *memory= swap still apply in these days where systems can have32 GB of memory. Besides the fact that it is always bad for a system to start swapping.

share|improve this question

migrated from stackoverflow.com Oct 2 '12 at 16:46

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Mokubai, Indrek, 8088, ChrisF, Doug Harris Oct 2 '12 at 20:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3  
It is not always bad for a system to start swapping. It is bad to start reading from swap back. –  Michael Krelin - hacker Oct 2 '12 at 16:26
    
There is probably never a reason to have more than 4GB of swap space. My university has a machine with 64GB of ram and it has 8GB of swap. –  Wug Oct 2 '12 at 16:26
    
Are you running a server that might start an uncapped number of server threads or processes lying dormant for a long time? Is it a mail server? –  Dmitri Chubarov Oct 2 '12 at 16:28
add comment

1 Answer

Yes, there are reasons.

  • Most notably for linux desktop PCs, you'll find that you cannot do hibernation without any swap.

  • Servers with very diverse use might profit from using more memory for file system buffers and sending some unused processes to swap for that (like, for example, mailman processes on a not very frequented mailinglist). Keyword here is swappiness (link goes to askubuntu, but it mostly applies to linux in general).

share|improve this answer
    
So, for hibernation, we still need at least as much swap as active RAM right? –  terdon Oct 2 '12 at 16:57
1  
With active meaning, the amount of ram you actually use. Not sure about buffers and caches, linux might be smart enough to free these first if swap isn't sufficient. –  Jonas Wielicki Oct 2 '12 at 17:29
2  
Disk is insanely cheap compared to ram so you might as well go 1.5x and not risk any problems. If you can split the swap over multiple spindles, so much the better. Just because you have the swap doesn't mean you should use it, however: One access to disk will blow out of the water whatever nice performance you were getting from fast CPUs. –  Brian White Oct 2 '12 at 18:15
add comment