Bug 479740

Summary: Unreasonably high CPU usage
Product: [Applications] plasma-systemmonitor Reporter: madcatx
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ahiemstra, nate, plasma-bugs
Priority: NOR    
Version: 5.92.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: plasma-systemmonitor CPU usage on an idling system
Comparison between plasma-systemmonitor and htop
Function call flamegraph from Hotspot (only the important bit)

Description madcatx 2024-01-13 14:52:03 UTC
This issue is very likely not related to plasma-systemmonitor directly but it is the only tool from the KDE suite I have available.

For a program that is supposed to query statuses of system utilization once it a while, the program seems to utilize the CPU a lot. On an otherwise completely idle system, plasma-systemmonitor will use anywhere between approx. 15 - 25 % CPU when showing the list of all active processes. I don't have the CPU usage readout normalized so the maximum would be 800 % on my Intel i7-3632QM.

For comparison, similarly configured htop never uses more than ~8 % CPU. For further comparison, on this system, Firefox playing Full HD video stream needs about 30 % of CPU time (all non-normalized).

According to the profiler, most of the time is spent inside the Qt signalling machinery. I built both plasma-systemmonitor and libksysguard with debugging information and frame pointers enabled so the perf log is hopefully accurate enough.

I installed plasma-systemmonitor only when I started testing Plasma 6. I don't recall any of the Plasma 5 resource monitoring tools to ever even show up on a CPU-usage-sorted list and I was using those tools a lot.

I attached some screenshots to illustrate the problem better. Mind that the sampling rate and CPU frequency scaling obscures the readout a bit.
Comment 1 madcatx 2024-01-13 14:52:35 UTC
Created attachment 164864 [details]
plasma-systemmonitor CPU usage on an idling system
Comment 2 madcatx 2024-01-13 14:53:53 UTC
Created attachment 164865 [details]
Comparison between plasma-systemmonitor and htop

On this screenshot, Firefox is playing a randomly picked Twitch stream set to 1080p/60fps quality.
Comment 3 madcatx 2024-01-13 14:54:47 UTC
Created attachment 164866 [details]
Function call flamegraph from Hotspot (only the important bit)
Comment 4 Nate Graham 2024-02-15 21:55:04 UTC

*** This bug has been marked as a duplicate of bug 434877 ***