Monday, October 02, 2006

Tips on creating SWAP partition

What is swap partition? : Save all of the technical explanation. If you are familiar with virtual memory in Windows, then SWAP does the same thing. If you are not, then SWAP partition is a partition where it becames the "secondary memory" apart from your physical memory (also commonly known as "RAM").

Say you have a piece of RAM with capacity 512MB. If your computer (running on Windows XP) uses memory more than 512MB (or eventually does), then your windows WILL NOT prompt out the message "Sorry, your are out of memory!!". Instead, windows will initialize a space of your hard disk (usually c:) drives to become "a memory" (that's why it is called virtual memory) to support the insufficient space in the physical RAM. This is the time where you will experience "slow moment" with your computer - tasks which takes 1 seconds to be completed with physical RAM may takes 3 1/4 months if it is on virtual memory!! (source:kingston.com).
p/s: so in case you running out of memory , buy a new RAM. Avoid virtual memory.

So as the SWAP partition. In Microsoft Windows, virtual memory is automatically set up by default (you may choose to change it manually in advanced properties). But in linux, you have to initialize the capacity of SWAP (virtual memory) by yourself - that's it by creating a special partition just for this virtual RAM purpose.

So how do I choose the size/capacity of the SWAP partition?
The general rules (and commonly applied nowadays) is to set up the value capacity of SWAP equals to double the size of the physical RAM. eg you have 256MB of physical RAM, then you need to initialize the size of swap to 512MB.

But since nowadays computers are advanced and may be powered by RAM which is much bigger than 512MB, say 1GB. If this is the case, you DO NOT have to initialize the size of SWAP up to 2GB!! It will be a waste of hard disk space. Since for general use, it is difficult for your RAM to even reach the consumption/resource allocation more than 1GB.

0 Comments:

Post a Comment

<< Home