What to Do if the CPU Has a High Consumption in Linux and Goes to 100%

Your Linux PC suddenly freezes and you don’t know why? Do the fans start spinning at full speed out of the blue? There are many reasons why the CPU consumption in Linux can skyrocket causing notable problems, but the most common is that there is some application that is not working correctly. In this article we are going to show you how to discover what is happening and how to fix it as soon as possible.

There are many people who defend GNU / Linux as an operating system for their computers, since it is free and open source unlike Windows. However, although in general terms it is a very stable operating system, it is not without problems, and one of them is precisely a high CPU consumption, especially in old systems or with low-power processors that, curiously, are the most used with this operating system given its low requirements.

CPU High Consumption in Linux

Finding the culprit of high CPU consumption in Linux

As we have mentioned in the introduction, as a general rule the problem lies in an application that is not working as it should, taking up all the system’s processor resources and causing the rest of the applications to not have enough resources to function properly. Thus, the first thing we must do is find the culprit, and for this you must open the System Monitor application or open a command console and execute the ” top ” command.

Comando Top Linux

By default, the processes will appear ordered according to their CPU consumption precisely, so the applications that are consuming the most resources will appear at the top. If any of the apps have 100% CPU usage (or almost) all the time for no apparent reason, they are likely to blame for your problems.

The Top command includes support for both restarting and “killing” an application, but if it is a critical application that you do not want to close, just to stop giving problems, you can first try changing the priority. On Linux you can assign priorities from +19 to -20, and the higher the number, the lower its priority. Inside Top press the “R” key and then enter the PID of the application that causes problems (you have the PID in the first column). Try putting a value of +5 to start, and if it doesn’t lower your CPU consumption, try +10 or +15 instead.

If the application is not responding or changing the priority does not work, you can always “kill” it. To do this, also at top press the K key; then you will be asked to enter the PID of the application to which we are going to send the kill command, and after doing so it will disappear.

Comando kill

If the problem was that an application was not working properly and was consuming all the processor resources, with this you should have finished it.

If the problem persists, update everything

If the problem persists every time you run the application again, it is best to update both it and the operating system itself. To do this, open a terminal and simply run the following command:

sudo apt update && sudo apt -y upgrade

Let it finish (it may take a few minutes depending on what you have to update), and after that try to run the problematic application again to see if it gives problems again.

If so, it is possible that the problem is that there is some wrong parameter in the configuration of the application itself, so the quickest solution is to uninstall and install it again or look for an alternative.