Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

How to manage the use of swap memory

Date: 2007-03-17 00:00:00 -0400

The use of the swap memory by default on Kernel 2.6.xx is set to 60% that means that the system will use intensively the swap memory, this is good if we have a small amount of memory and lot of load on our PC or server, but if we have plenty of RAM or we are using a Desktop machine, we maybe do not need this setting, let's see how to change it.

This is valid for Ubuntu, Debian, Fedora and CentOS

On a Terminal do this as root (use sudo if running Ubuntu)

cat /proc/sys/vm/swappiness

You should see 60, now change it to 10

sysctl -w vm.swappiness=10

Now is time to work for some minutes with some applications if you see that is better, you can make the changes permanent.

vim /etc/sysctl.conf

and add this line at the end (if it does not exist, otherwise edit it)

vm.swappiness=10

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.