Why is it recommended that the swap partition size be double that of the RAM size?
Specifically, why would I need to store data stored in the RAM twice??
|
|
|
Swap partition having double the memory size is just a general guideline, not a hard and fast rule. You'll need minimum 1 X your memory size if you suspend-to-disk (hibernation), and add enough spare for usage of 'swapped' memory which goes beyond your physical one. Hence the recommended 1.5 to 2 times. I would think it also depends on the nature of your application usage and size of your physical memory etc. If you have anything beyond 2GB RAM and using non-memory intensive applications most of the time, you might not need swap partition at all, not big one anyway. Having a big swap file and slow harddisk can be really punishing for your system too. Here are a few useful reads: Ubuntu SwapFAQ |
|||
The swop is simply for freeing up system memory. If you begin to run low on memory the system will free up memory by moving the least used data from memory onto the hard disk swap file. This of course has a speed penalty but it frees up memory for other applications. With memory being so cheap you are always better off to have as much as you can afford. This way the swap gets very little access and your system stays nice and fast. |
|||
|
|
|
With a larger swap space, programs can use more RAM than is present on the computer. This is possible because even if the data takes up more space than fits in the physical memory at once, it cannot all be accessed at once - the swap is pulled into physical memory as it is needed. The alternative is to have programs randomly killed when memory runs out. This is particularly useful if you want to edit high resolution images or videos, or do 3d modeling or rendering, or run numerical analysis on large amounts of data, there are many kinds of programs that end up wanting insane amounts of RAM, where it is better to be able to have it run very slow than to have it unable to run at all without crashing. |
|||
|
|