About Me

header ads

How to control the amount of RAM used by Ubuntu

With the arrival of Ubuntu 10.10 (probably) on Sunday 10/10, it is expected that a large number of people want to test the system, installing or upgrading from an older version already installed. So, knowing that such a trick to optimize memory usage in Ubuntu?

First of all, a quick explanation: Linux by default uses a special partition as swap memory system, and maintains a standard configuration, regardless of how much RAM you have on your computer.


Thus, in a post-installation, regardless of whether you use 1 or 4 gigabytes of RAM, the system will always use a standard percentage and allocate the rest to the memory swap. The problem is that if your machine has too little RAM, can be more interesting set the system to use more swap memory and thus be able to run multiple programs at a cost of some performance. Otherwise, if your machine has RAM to spare, you may want to use it the most.

This is where you enter the parameter swappiness. He defines, in Linux, how much RAM is used. And this setting can be changed as needed by the user. To determine the current value of swappiness on your machine, run the following command in Terminal:
  • sudo sysctl -a|grep swappiness
The result screen should look like
  • vm.swappiness = 60
And what's that worth? Swappiness parameter can have values ranging from 0 to 100, where:
  • 0 tells the system to allocate as much resources as possible directly in RAM
  • 100 tells the system to allocate as much of that is not currently in use by the memory swap

So, if you set this value to around 100, the programs will start faster, because there is plenty of room in RAM. On the other hand, values close to 0 will cause programs to behave better after opening.

And what is the best value to use? That depends entirely on you, the equipment you are using and the programs you want to rotate. The best way to find out is to go slowly changing values until you feel that the system is the way you like.

To change the value of swappiness, run the following command in Terminal:
  • sudo gedit /etc/sysctl.conf
The configuration file opens in text editor. Now, look at vm.swappiness parameter and change the value that is there. If the parameter is not in the configuration file, you can type it out like this:
  • vm.swappiness = “XX”
Where XX is the value you want to use. Restart Ubuntu and see if the programs are behaving the way you like. Otherwise, change the values until you get to your liking.

Post a Comment

0 Comments