Bug 359580 - High CPU usage
Summary: High CPU usage
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.5.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-02-19 17:28 UTC by kdebuac.rhn
Modified: 2018-10-29 02:14 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
CPU hogging plasmashell console output and geb backtrace (22.54 KB, text/plain)
2016-03-10 19:42 UTC, squan
Details
GDB backtrace of plasmashell CPU hogging process (25.68 KB, text/plain)
2016-04-04 07:14 UTC, squan
Details
plasmashell output (3.95 KB, text/plain)
2016-07-25 19:51 UTC, kdebuac.rhn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kdebuac.rhn 2016-02-19 17:28:45 UTC
Plasma shell CPU usage is high for no apparent reason.
It starts at about 5% at restartand increases at least up to 90% over the course of a few hours.
It takes about the amount of time to write this bug report to cross the 7% threshold and stay there.

Reproducible: Always

Steps to Reproduce:
1. (re)Start plasma: kbuildsycoca5 && kquitapp5 plasmashell && kstart5 plasmashell
2. Use the desktop

Actual Results:  
CPU usage increases.

Expected Results:  
CPU usage stays around initial level.

Plasmoids: clock, task switcher, CPU/RAM/net monitors, desktop switcher, activity switcher, icons, system tray, launchers, folder view.
Standard Fedora panel items: battery, GTK systray, clipboard, mixer etc.
All plasmoids on the panel only.
Comment 1 squan 2016-03-07 20:11:57 UTC
Since  a 'zypper up' (on tumbleweed) to plasma5 packages  5.5.5-1.1 
- plasmashell uses permanently 100% CPU immediately after login and
-  the plasma panels (two, both autohide) do not appear.
Commands via Alt-F2 and logout via Ctrl-Alt-Del still work.
Also
   kquitapp5 plasmashell
just blocks and does not kill plasmashell (good old kill works of course).
I'm not sure wether I'm hit by  this bug or by a worsened variant of bug 356479 .
Comment 2 Martin Klapetek 2016-03-10 14:34:47 UTC
Thanks for the report

Can you please do two things:

1) Start plasmashell from Konsole and post the output when the CPU gets high

2) Attach gdb to plasmashell process when the CPU usage gets high and post the backtrace

In case you're not familiar with gdb, follow these steps:
* open Konsole and run "sudo gdb --pid `pidof plasmashell`"
* wait a bit
* type "thread apply all bt"
* copy & save the backtrace
* type "q" hit enter
Comment 3 kdebuac.rhn 2016-03-10 15:17:43 UTC
Between restarts of plasmashell and kwin, the CPU usage has stabilized and appears rarely. I will try to collect the data if I get the chance.
Comment 4 squan 2016-03-10 19:42:12 UTC
Created attachment 97824 [details]
CPU hogging plasmashell console output and geb backtrace

(In reply to Martin Klapetek from comment #2)
Luckily I'm still affected by the problem (immediately after starting KDE) on two computers but not for every user.

> 1) Start plasmashell from Konsole and post the output when the CPU gets high
The output contains e.g.
Both point size and pixel size set. Using pixel size.
file:///usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/DigitalClock.qml:444:5: QML Text: Cannot anchor to a null item.

Note:
A rpm query shows that this DigitalClock.qml is from the same package plasma5-workspace-5.5.5.2-1.1.x86_64 as the plasmashell executable
The installed  plasma5-desktop is 5.5.5-1.1.x86_64 though.

> 2) Attach gdb to plasmashell process when the CPU usage gets high and post
> the backtrace
Statistical sampling with gdb shows that the plasmashell process is busy with 
#0  0x00007ff5e03c5a30 in  () at /usr/lib64/libQt5Qml.so.5
#1  0x00007ff5e03c6818 in  () at /usr/lib64/libQt5Qml.so.5
#2  0x00007ff5e03c67f4 in  () at /usr/lib64/libQt5Qml.so.5
#3  0x00007ff5e03c686c in QQmlIncubator::forceCompletion() () at /usr/lib64/libQt5Qml.so.5
#4  0x00007ff5e1491f3e in KDeclarative::QmlObject::rootObject() const () at /usr/lib64/libKF5Declarative.so.5
#5  0x00007ff5e2f0de3d in  () at /usr/lib64/libKF5PlasmaQuick.so.5
#6  0x00007ff5e1047599 in QQuickItem::setY(double) () at /usr/lib64/libQt5Quick.so.5
#7  0x00007ff5e103fa74 in  () at /usr/lib64/libQt5Quick.so.5
#8  0x00007ff5e1042d2b in QQuickAnchors::qt_metacall(QMetaObject::Call, int, void**) () at /usr/lib64/libQt5Quick.so.5
#9  0x00007ff5e03bda7f in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlContextData*, QFlags<QQmlPropertyPrivate::WriteFlag>) ()
    at /usr/lib64/libQt5Qml.so.5
#10 0x00007ff5e038547e in QV4::QObjectWrapper::setProperty(QObject*, QV4::ExecutionContext*, QQmlPropertyData*, QV4::Value const&) () at /usr/lib64/libQt5Qml.so.5
#11 0x00007ff5e0385a89 in QV4::QObjectWrapper::setQmlProperty(QV4::ExecutionEngine*, QQmlContextData*, QObject*, QV4::String*, QV4::QObjectWrapper::RevisionMode, QV4::Value const&) () at /usr/lib64/libQt5Qml.so.5
#12 0x00007ff5e0385bc1 in QV4::QObjectWrapper::put(QV4::Managed*, QV4::String*, QV4::Value const&) () at /usr/lib64/libQt5Qml.so.5
#13 0x00007ff5e0394d62 in QV4::Runtime::setProperty(QV4::ExecutionEngine*, QV4::Value const&, int, QV4::Value const&) () at /usr/lib64/libQt5Qml.so.5

Details attached.
Comment 5 squan 2016-04-04 07:14:04 UTC
Created attachment 98234 [details]
GDB backtrace of plasmashell CPU hogging process

I'm now having the problem with a recent install of openSUSE leap (42.1):
plasmashell on startup always uses 100% CPU and does and panels never show up.
Also
-  on Alt-F2 the command input field pops down only to immediately disappear and
- the small menu icon in the left top screen edge does not react on click.
I.e. the plasma shell is effectively unusable.

Since I did not have this problem after initial installation (which had plasma-workspace-5.5.4-9.1) the problem may be the result of an update to plasma-workspace-5.5.5-12.1 from the openSUSE distribution update repository.
Comment 6 squan 2016-04-16 12:39:51 UTC
(In reply to squan from comment #1 (and comment 4f))
> Since  a 'zypper up' (on tumbleweed) to plasma5 packages  5.5.5-1.1 
> - plasmashell uses permanently 100% CPU immediately after login and
> -  the plasma panels (two, both autohide) do not appear.

This differs a bit from the originally  reported behavior  and got resolved for me with a recent update of tumbleweed packages to plasma-5.6.1-1.1.
Still happens on opensSUSE Leap though (since it does not happen for all users it _could_ be related to a CPU load widget).
Comment 7 kdebuac.rhn 2016-07-25 19:51:48 UTC
Created attachment 100299 [details]
plasmashell output

Several minutes of output from plasmashell when the usage increases for no reason.
Comment 8 kdebuac.rhn 2016-07-25 19:56:03 UTC
After upgrading Fedora to kf5-plasma.x86_64-5.23.0-1.fc23, the issue came back worse. It takes an hour or two for Plasma to reach the whereabouts of 20% CPU usage (this is total Plasma + X, so maybe display related) and stay there for days (until killed).
There's nothing special in the logs that I could see.
The plasma-nm plugin is known to me as an offender when it comes to killing CPU with unnecessary refreshes.
Comment 9 Jaime Torres 2017-12-23 14:20:54 UTC
One of my sessions has high cpu also, a constant 20% cpu ussage.
Launching plasmashell using callgrid, I see that the problem is in Qt calling fontconfig again and again. From previous investigations, my guess is that this only happens in QtQuick and only when personal fonts are available, because last time I moved the personal fonts to the global fonts directory the high cpu was gone after plasmashell restart.
Comment 10 Andrew Crouthamel 2018-09-28 03:30:38 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Andrew Crouthamel 2018-10-29 02:14:34 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!