This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to debug CPU usage

Tags: None
(comma "," separated)
holgerk
Registered Member
Posts
12
Karma
0

How to debug CPU usage

Sun Feb 27, 2022 10:18 pm
Hi,

My Laptop regularly shows one CPU core eaten up by some random process - and according to my fan and the emitted heat, this is real and not only imagination. Now, when I send the Laptop to suspend2RAM and immediately wake it up again, the rouge process is gone. The flatline in the CPU-graph lasts sometimes for 10 seconds, sometimes for 10 hours. But it returns and starts eating up my CPU again and again.

According to KSystemMonitor, it prefers to linger in CPU #2 by the red color and the reading. But it might also switch to others at times.

For long time, I was blaming this on Firefox, as it was the application with the most CPU-usage during that time or it was the active application in the foreground, when the bug hit again and again, though I was only slowly scrolling through an already loaded article ... Here is my old bug report, that turned up nothing: https://bugzilla.mozilla.org/show_bug.cgi?id=1700200

Meanwhile I bumped the Firefox version a few times as well as updated from Kubuntu 21.04 to 21.10, the problem still persists with the same lame workaround: Just make the CPU sleep a few seconds and it goes back to normal. Sometimes I need to repeat this 3 times in 3 minutes. You see, it is really annoying. The alternative is to ignore the CPU-fan and the noise and the heat ... usually during Winter, I can tolerate the bug a little easier. But you know, summer is coming ...

So why am I bothering you with this? The bug now manifests, after a clean system start, BEFORE I even open Firefox:
Image

At first I thought, maybe Thunderbird - also running a Gecko engine? But no, Thunderbird was also not started jet. As you might notice, the red curve raised for a second time. But I sent the computer to sleep for a second time immediately, as I was closely watching KSystemMonitor at that moment.

Now I thought, with Mozilla-software out of the way, it should be easy to identify the culprit ... So I switched to the task view, sorted by CPU time and ended all the other little applications, that made it to the top of the list. The last remaining was *tata* KSystemMonitor itself. Can't be, because I trust my ears and I know the fan is running even when KSystemMonitor is not running.

Next I opened the commandline and ran top instead of KSystemMonitor - same result. Finally here is a session with htop claiming up to a staggering 31% CPU for itself:
https://asciinema.org/a/DOpMjOUORJkoYChV0WmutyJBJ

There must be something in my profile, because I was testing a vanilla user on the same hardware and it does not suffer from the issue - at least not for up to ~10 hours spread over 2 days, suspending over night.

Questions:
  • How to identify the issue in my profile? Is there a way to test "half" of my configuration in the new user?
  • Any ideas on nailing the task that is causing the CPU-usage? Why would any CPU-Monitor report itself as eating up one core for itself?
  • What could possibly explain CPU returning to normal after wake-up from suspend2RAM? If there is something wrong with the hardware, why does it not manifest for the fresh vanilla user/profile?

Good night
Holger
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS

Re: How to debug CPU usage

Mon Feb 28, 2022 2:14 pm
It shows something you installed using snap, check those.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]