Sufficient RAM available still System running slow

In this article, we cover how to speed up your Linux system even when there is sufficient RAM available. If we multi-task or run applications that take up much of the RAM space. Our system begins to lag. Even the text-based interface commands take time.

This shows we have used quite a bit of RAM and it is time to free it up. So, we begin to close applications that we don’t require. And, in most cases, our system gets back to normal functioning.

But, that doesn’t happen at all times. And, there could be multiple reasons which lead to this particular system state. One of the reasons is: Our system is still using swap space despite a sufficient amount of RAM available.

Sufficient RAM available still System running slow

So, the situation has risen due to a lower Swappiness value. We were in a similar situation recently. The Swappiness value for our system was set at 30. We can see the value through the command:

cat /proc/sys/vm/swappiness

By default, it is set to 60. We can alter the values through the command:

sudo sysctl vm.swappiness=x

where x should be between 0 to 100. Higher values indicate that it would Swap faster. On the other hand, a lower Swappiness value means less Swapping.

At this stage, we need to free Swap space. And, we can achieve that by shifting the Swap data to RAM space. For that, we have to disable Swap space and once the data has moved to RAM space, we need to enable Swap space again.

So, to disable Swap space:

sudo swapoff -a

Now, wait till the data has entirely moved to the RAM space. We can monitor that through GNOME System Monitor or the following command:

free -m

Once it is done. Enable the Swap space again:

sudo swapon -a

Lastly, there could be numerous other reasons which could make your Linux system run slow. We hope the workaround provided in the article helps you to get things back to normal.

Similar Posts