Decrease the use of swap on Ubuntu

What is swap and how to configure it to best to make our computer faster

Swap is an area on the hard disk that is used when the RAM is full, and consists in the transfer of the old processes for the introduction of the new.

How sly can be this solution, you can turn them against in case you have a computer with little RAM memory, because the process of transferring processes from RAM to swap (and vice versa) takes more CPU. The solution is to increase the margin of the filling of the RAM.

By default, the swap area begins to be used to achieve 60% of the capacity of the RAM, then to reduce the exchange processes enough for us to increase this percentage (for example 90%).

To do this, just use this Terminal command

sudo gedit /etc/sysctl.conf

At the end of the file add

vm.swappiness=10

Save and reboot the computer.

We periodically check the functioning of the links in our articles. If you notice any links that do not work, please let us know in the comments. If you enjoyed the article consider supporting the blog with a small donation. Thank you. Patreon / Ko-fi / Liberapay / Paypal

Leave a Reply

Your email address will not be published. Required fields are marked *