How much swap memory is enough?


What is swap memory?

In Linux, and in other Operating systems is the same, a swap file memory or partition is an extension of the real physical memory. The operating system (Linux in this case) will store in the disk segments of the physical memory that it is not being used at the time, to free memory for new applications that may need it.

Memory is very cheap today, and it is not difficult to have 8 GBytes of physical memory in any Desktop or even Laptop.

So, are you still need swap memory? Probably not, and almost sure not a swap memory size that doubles the physical memory as it was in the old days.

I think, if you have from 8 G Bytes or more, you do not really need swap memory at all, if you have from 4 G Bytes or less, maybe 1 Gigabyte of swap would be fine, 2 at the most. That applies for Desktops or servers.

If you are running a VPS with less than 1 Gigabyte or physical memory, you may want to equal the size of the swap to the size of your physical available memory.

If you are installing Linux on a laptop, you will have to equal the size of the swap memory to the physical memory in order to the be able to suspend to disk. When you suspend to disk all RAM is written in the swap area and then the power is turned off, if there is not enough space to allocate all physical memory in the swap memory the process will fail.

Consider those points next time you install Linux.

About pacesettergraam

A good and realistic person

Posted on December 21, 2012, in linux and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: