I noticed a while back that my CPU usage was suddenly constantly going somewhere between 30–40 % with Xorg using most of it (e.g. now the total usage is 34 %, top shows Xorg using 29 %). The usage used to be something around 5% when working and running multiple tasks, but now it’s up there even on idle right after logging in.
There’s no real lag or anything noticeable, just the stats and the fan running like a maniac. But I’d still like to fix this.
So I have both integrated GPU and a dedicated GPU. I have always used the dedicated one explicitly, as the hybrid mode hasn’t really worked. I’ve read that the hybrid mode with Nvidia can use a lot of CPU though, so I’m thinking if something has changed in that regard or if something has messed up my graphics drivers etc. In BIOS the graphics are set to use the discrete card, so the hybrid model shouldn’t work in any way though.
But of course, the reason could be anything, might be something that’s not related to graphics at all.
Using the laptop’s monitor only or having external monitors (2 x 4K displays) connected has no real effect on the usage. I have also tried disabling picom, as it was an issue a long time ago, but it has no effect here anymore.
Have you tried looking at System Monitor? It comes with Manjaro as default. Check the tab Applications in it for example. Maybe something didn’t close completely.
If you prefer the terminal, top, htop etc.
ps -fp “ProcessID” could give a clue too, once you have Xorgs PID. Should be similar/exactly to what htop shows though. But in htop Xorg jumps around for me so harder to read.
Example: ps -fp 1024
Thanks to all of you, and sorry for a bit of a delay before getting back to this. So I just rebooted and have only started Firefox with this page open and Kitty for running the commands.
Running
top --batch --iterations=1 --sort-override=%CPU | head -n 30
…gives me:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1660 root 20 0 24,2g 68548 46100 S 18,2 0,2 0:43.38 Xorg
1716 me 20 0 863056 23532 20460 S 9,1 0,1 0:16.77 polybar
1719 me 20 0 863064 23336 20520 S 9,1 0,1 0:16.86 polybar
250527 me 20 0 14840 7516 5468 R 9,1 0,0 0:00.01 top
1 root 20 0 22644 13160 10052 S 0,0 0,0 0:01.72 systemd
The CPU percentage of Xorg is a bit less than what it’s been the past couple of weeks, but still way higher than what it was prior. I also have only the laptop display in use at the moment.
I might do some common tasks for a while and see what happens, usually the percentage gets higher pretty quickly.
18% seems crazy high to me.
With a 6-core 5600X, Xorg sits at 2-3%. With a browser open, watching Twitch.
And why is Virtual so high? 24 gigs? It sits at 1.3 gigs for me. Anomalies for sure.
Polybar, sounds like custom. Did you edit xorg.conf or make files inside /etc/X11/xorg.conf.d/
in the past?