1. Find the Culprit
A misbehaving app can bring even the fastest processors to their knees. You can use the System Monitor app or top in the Terminal to find the problematic application. Open your terminal, type top, and press Enter. By default, all processes are sorted according to their CPU utilization, with the most CPU-hungry ones at the top. If an app is always in one of the top five slots with a CPU utilization rate significantly higher than the rest, you’ve found the culprit.
2. Renice or Kill the App
Top includes support for both renice and kill. You can use these tools to change the priority of any process or forcefully stop it. An app’s nice priority refers to the amount of CPU resources it’s allowed to use compared to the other running processes. Nice accepts values from +19 to -20. The higher the number, the lower the priority. In top, press r and enter the problematic app’s PID. Try changing it to a “+5” value, and if that doesn’t help, retry with “+10,” “+15,” and finally the lowest possible priority, “+19.” If the app is unresponsive, you should stop it immediately. Press k while in top, enter the PID, press Enter, and the app will be gone.
3. Update Everything
If the problem persists every time you run the app, updating it may fix the issue. In your terminal, enter: After that, try running the problematic application again.
4. Remove and Reinstall the App
If the problem isn’t fixed, there’s a slight chance it appears because of a wrong parameter in the program’s configuration. Resetting it to its original state may help. First, back up your configuration in case it wasn’t the cause of the problem and you need to restore it later, then purge the problematic app: Reinstall the app: This will reset the app to its original state.
5. Revert to the Previous Version
If upgrading the app didn’t solve the problem, you can revert to the previous version instead. Try downgrading and using an older version – at least until the developer has fixed the bugs in the app. To downgrade your app, first check out the available versions by running your terminal and issuing: Your currently-installed version will have three asterisks next to it. Take note of the other available versions. Before downgrading, we suggest you purge the existing version to eliminate any configuration-related problems. Install the older version with:
6. Use Alternative App
The good thing about Linux is that there are many apps that can do the same thing. If one app is causing high CPU usage, you can and should replace it with an alternative. For example, LibreOffice Writer can be a demanding piece of software, as it relies on many dependencies to run properly. One great alternative to this application is Abiword. To install it in Ubuntu, run the following command:
7. Optimize Your System’s Power Settings
Another simple way to fix high CPU usage in Linux is to make sure that your machine can fully utilize its system resources. For the most part, a modern laptop will cap the maximum CPU frequency to conserve its battery, resulting in a slower laptop that constantly peaks in CPU load. The quickest way to optimize your machine’s power settings is in your system settings menu. To do this in Ubuntu, press Win and type “settings.” Select the “Power” section from the window’s left side bar. Select the “Balanced” option under the “Power Mode” category to allow the system to automatically allocate CPU resources whenever you need them. Reboot your system to ensure that Ubuntu will apply your new settings correctly.
8. Install a Lightweight Desktop Environment
Aside from installing alternative applications and optimizing settings, you can also fix high CPU usage in Linux by installing a better desktop environment. One of the lightest environments for Linux is LXQt. Unlike GNOME and KDE, the developers of LXQt are dedicated to creating a complete desktop that can run on as few resources as possible. To install LXQt in Ubuntu, run the following command: Log out of your current session and select the gear icon on your login screen to display all of the available desktop environments in your system. Select “LXQt” and log in to your account.
9. Fix Core Apps Causing High CPU Usage
What happens if what’s eating up your CPU is a core app, like systemd or Xorg? For systemd, try disabling non-essential features and secondary devices on your computer, such as joypads and printers. If the device is a joypad, mouse, or keyboard, and you’re running Ubuntu or a compatible distribution, type xinput in your terminal to see all of the connected devices. To disable one of them, use: To reenable the device, swap disable with enable in the above command. For other devices, the solution is somewhat more complicated. First, you’ll have to enter lsmod in your terminal and press Enter to see all of the extra drivers your Linux kernel loads as modules. Find the one for the offending device and note down its name, then enter the following: The document you just opened is a blacklist of modules that shouldn’t load during boot. It will probably already be populated with some entries. Move to the end of the file and follow the same syntax to add your module to this list. Your entry should look like: Save the file, reboot, and hopefully, everything will work okay now. For Xorg, try disabling your Window Manager’s compositor. Although officially the compositor offloads CPU-related tasks to the GPU, that’s not always the case. Sometimes, by enabling compositing support, you’re also enabling many demanding effects. Sometimes the GPU’s drivers can cause high CPU usage, too. Xorg doesn’t really get along with specific versions of Nvidia’s or AMD’s drivers. The solution is upgrading or downgrading to a different version. Alternatively, you can try open-source versions of your GPU’s drivers. Still, those don’t share the exact feature set and may lack some functionality.
10. Swap Your Kernel
It’s rare for the Linux kernel to be the reason for high CPU utilization. Still, if you’ve reached this point with no solution in sight, you won’t lose anything trying a different one. As stated on its official site, to install the popular Liquorix kernel in Ubuntu, visit your terminal and type: This will add its repository to Ubuntu’s sources. To bring the kernel itself onboard, use: Reboot to enable your new kernel, and, hopefully, your CPU utilization will be back to normal levels. Image credit: Unsplash. All alterations and screenshots by Ramces Red. To do this, run kill -STOP followed by the PID of your program. Once you have the resources to run your program, resume by running kill -CONT.