Plasmashell, kglobalacceld and dolphin very resource intesive usage (CPU + RAM + Disk Write)

Hello!

Big post with an issue that is driving me crazy during days.

PROBLEM DESCRIPTION

I have an up to date opensuse tumbleweed kde installation with the following problem:

Just after boot, there are two processes that have a high CPU, memory and disk rate consumption: plasmashell and kglobalacceld.

Their CPU consumption is > 50% of a single CPU core. Their memory consumption is unlimited and grows overtime and they can use dozens of GB after some uptime. Their disk rate usage can be > 4 M/s of disk write sustained continously, even if sometimes is less.

If I open dolphin file explorer then it usually also behaves like those processes (in CPU, RAM and disk write rate).

Then, if I close dolphin and terminate kglobalacceld from terminal, the CPU usage and disk write rate of plasmashell drops to 0%. In fact, neither of the 3 processes by themselves are enough to make trouble. But any combination of two of them, or the 3 at the same time, causes their processes to go crazy on resources.

From the user experience, the taskbar feels unresponsive. When I click in the taskbar menu or some taskbar icon usually it doesn’t respond after a few or several minutes later. Also, notifications can be frozen there for the same amount of time. When that happens, then also systemd gets stuck at stopping plasmashell from terminal. And it’s not until plasmashell gets responsive again that it honors systemd stop signal and it closes. But then, if meanwhile systemctl is waiting for plasmashell to stop I also stop kglobalacceld from systemd, then plasmashell closes just after (but this very last thing I have been only able to test it twice, and probably with dolphin closed)

Also there are some minor problems like when I browse through the start menu categories (utilities, games, etc), the programs inside those categories dissapear just after appearing, but it could be unrelated to the main issue.

This issue has been persistent through several system upgrades, so it’s not comming from last tumbleweed update being unstable.

The hardware is a powerful thinkpad p16 gen 2 portable workstation with a powerful CPU, plenty of RAM and NVMe drives. It also contains an iGPU and a dedicated GPU (nvidia) and the loaded drivers are offload with nvidia modules loaded.

Also as an example, after 1h 13 min uptime:

  • plasmashell has +32 min CPU time, +8 GB of RAM and +14 GB written to disk
  • kglobalacceld has +29 min of CPU time, +7 GB of RAM and +13 GB written to disk

If I create a new user, the issue doesn’t seem to reproduce, so probably could be some of the configuration I did after I got the laptop. In fact, the installation is almost fresh and while I was setting it up, at some point close to the end I noticed that issue. Here I will try to make a list of the settings I applied to the system, but it’s only what I remember and it’s not an exhaustive one:

  • Changes in the scalation for sddm, kde, etc (4k screen)
  • National instruments software installation (almost for sure not the cause since it’s completely closed)
  • NVIDIA drivers installed and prime-select installtion. Offload drivers selected.
  • Flatpak installation + a few flatpak packages.
  • Packman repo enabled with a few pacman packages installed like ffmpeg and somewhat else
  • Pre-installed dark breeze global theme. At some point I placed some widgets on the taskbar. But right now are all deleted and the issue persists.
  • Installation and configuration of onedrive client from repo-oss (GitHub - abraunegg/onedrive: OneDrive Client for Linux)

EXTRA INFO

I don’t know if onedrive could be part of the issue, since I have almost 400k files sync with 110GB of data. Since the onedrive folder is inside my home folder, it has been automatically indexed. But a weird issue appeared where baloo said that 80k files were indexed and no more files were remaining to index, but the home directory has 500k files itself. Anyway, stoppping baloo and onedrive service doesn’t seem to really change the issue.

As extra info, I’m running on X11. If I start on Wayland then the issue persists and on top of that the mouse gets frozen a little fraction of a second every second or every few seconds, which is really annoying and makes me dizzy at the end. Also, if I try to unload nvidia drivers running sudo prime-select intel it doesn’t return to the intel drivers after rebooting and still uses the offload drivers with the nvidia modules loaded.

After some days trying to debug the issue with chatGPT it looked like the following fixed my issue:

rm ~/.cache/ksycoca*
kbuildsycoca5
kbuildsycoca6

But after rebooting the issue reappeared, and executing again the same commands didn’t fix the issue anymore, so in fact maybe was a mere coincidence.

Also this is the user journal just after a fresh boot:

journalctl --user --no-pager -u plasma-plasmashell -u plasma-kglobalacceld
-- Boot bc8d12ffe9e1459ea494cf529c9d12c3 --
de nov. 13 17:53:41 h-laptop-linux systemd[2246]: Starting KDE Plasma Workspace...
de nov. 13 17:53:42 h-laptop-linux systemd[2246]: Started KDE Plasma Workspace.
de nov. 13 17:53:42 h-laptop-linux plasmashell[2545]: kf.plasma.quick: Applet preload policy set to 1
de nov. 13 17:53:42 h-laptop-linux plasmashell[2545]: file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/main.qml:178:25: QML FolderViewDropArea (parent or ancestor of QQuickLayoutAttached): Binding loop detected for property "minimumWidth":
                                                      file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/main.qml:201:9
de nov. 13 17:53:43 h-laptop-linux plasmashell[2545]: Toolbox not loading, toolbox package is either invalid or disabled.
de nov. 13 17:53:43 h-laptop-linux plasmashell[2545]: file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/main.qml:50:9: QML KSortFilterProxyModel: Binding loop detected for property "sourceModel"
de nov. 13 17:53:43 h-laptop-linux plasmashell[2545]: file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/main.qml:50:9: QML KSortFilterProxyModel: Binding loop detected for property "sourceModel"
de nov. 13 17:53:43 h-laptop-linux plasmashell[2545]: qt.dbus.integration: Could not connect "org.cups.cupsd.Notifier" to PrinterFinishingsChanged(QString, QString, QString, uint, QString, bool) :
de nov. 13 17:53:43 h-laptop-linux plasmashell[2545]: QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0

DEBUG FILES (strace logs, journalct, etc)

Meanwhile trying to debug it with chatGPT it made me generate a lot of info that I saved on files that I will place here for further info with data from the system journal, strace, etc, etc

Some of those files are heavily truncated due to maximum file size. If you want the full ones and have journalctl highlighting: Upload files for free - kde_debug_logs.tar.xz - ufile.io

ChatGPT ANALYSIS OF THE FILES

(maybe is useless but… Also this a recap from different days and big conversations)

I’m not technical enough to understand most of those files, but chatGPT said thing like the following after readind them:

  • plasmashell and QML binding loops:
  • There are multiple binding loop warnings in plasmashell, such as:
    • "Binding loop detected for property 'minimumWidth'".
    • "Binding loop detected for property 'sourceModel'".
  • These may indicate UI or configuration issues, which could affect resource usage.
  • KWin and X11 Errors:
  • Several kwin_x11 errors related to QRect conversion failures:
    • "Conversion of '0,0,0,0' to QRect failed".
  • These errors might affect the window manager’s performance or interactions.
  • PowerDevil and Wayland:
  • Failures such as "Failed to create wl_display (No such file or directory)" indicate display-related issues, though you’re running on X11.
  • qt.dbus.integration Warnings:
  • D-Bus warnings like:
    • "name 'org.freedesktop.UDisks2' had owner '' but we thought it was ':1.32'".
  • These indicate potential communication issues between system components.

And from the strace files:

For plasmashell:

  1. Repeated write() calls:
  • There are many repetitive write() system calls to file descriptor 4. This could indicate a tight loop or logging/debugging output that’s contributing to high CPU usage.
  1. File Access Issues:
  • Several statx() and access() system calls fail with ENOENT, particularly for plasma/desktoptheme/default/colors. This suggests plasmashell is repeatedly searching for missing files in various locations.
  1. Permission Denied:
  • Attempts to access some paths, such as /root/.local/share/flatpak/exports/share/plasma/desktoptheme/default/colors, fail with EACCES. This is unusual since plasmashell should not be scanning root’s directories.
  1. Frequent Polling on File Descriptors:
  • The process repeatedly polls file descriptors (e.g., fd=15) for input, but the data size read (32 bytes) is minimal. This suggests a tight loop where plasmashell is excessively polling without meaningful work, consuming CPU unnecessarily.

For kglobalacceld:

  1. Repeated File Lock Handling:
  • The process repeatedly tries to access a lock file (ksycoca6_en_*) in ~/.cache, failing with EEXIST and then opening it in read-only mode. This might indicate a synchronization issue or excessive cache validation.
  1. ksycoca Cache Handling:
  • The process continuously interacts with the cache file (~/.cache/ksycoca6_*), reading and writing to it frequently. Despite clearing the cache, the persistent access patterns may indicate a deeper issue with cache generation or invalid entries.
  1. XDG Directory and File Access:
  • Repeated directory reads (e.g., /etc/xdg/menus and /etc/xdg/menus/applications-merged) and configuration checks show that kglobalacceld might be regenerating menus or scanning for application metadata excessively.
  1. Frequent clock_nanosleep() Calls:
  • Periodic sleeps (clock_nanosleep) suggest the process is waiting for events or trying to avoid a tight loop, yet the resource usage remains high.
  1. Minimal Data Processing:
  • Frequent reads and minimal processed data indicate inefficiency or an unnecessary loop during cache validation or menu updates.

Also, I forgot, with chatGPT I tried to reinstall plasma with sudo zypper in --force plasma6-desktop without any success and also things like:

  • lookandfeeltool6 -a org.kde.breeze.desktop
  • rm ~/.cache/ksycoca6* && kbuildsycoca6
  • rm ~/.config/plasma-org.kde.plasma.desktop-appletsrc

I feel that I’m on a point where I can’t push this anymore and feel like if I don’t get any external help I’m going to be stuck here forever. Thanks for your time!

Hello and welcome to the openSUSE forums.

As these are KDE/Plasma processes, I assume that they are NOT running “Just after boot”, but only after a user logged in in the KDE/PLasma desktop.

Yes, sure. For me as I only use the system from KDE it was the “same”. But the correct way to say it is just after logging in. I will edit on my original post (or not because I can’t).

My suspicion is in the first sentence I quoted above, i.e., that the issue is something that’s been configured for your main user account.

That is one troubleshooting step most folks will ask for out here … create a new user and see if the problem persists.

You provide a few bullet points as related to the second sentence I quote above (I did not include the bullet points). It might be interesting to log in as the alternate user account and execute each of the bullet points, one at a time, then check CPU usage.

Do NOT make all changes at once, because you may not discover “what” change introduces the issue.

I’ve checked one system (the laptop I’m on now) for usage stats for plasmashell and kglobalaccel. kglobalaccel pretty much shows zero activity, CPU and disk related. plasmashell obviously does show some CPU and disk activity here and there, but it’s very minimal … at most 1.0% (but mostly under).

(sidenote: admittedly, we use Leap 15.6 on all our machines, and not TW (but we used to run TW), with KDE Plasma and X11).

All is clear now.

It is rather common for people to forget that Unix/Linux is a multi-user, multi-session operating system. Specially when they think they have only one user (which is not the case) and even more when an automatic login of that user is configured.

And. now knowing about the real nature of Linux, can you create a new users and then try if that user experiences the same problem?

@hcvv wrote:

can you create a new users and then try if that user experiences the same problem

As the OP wrote in there original post:

Sorry, missed that.

A simple 'Net search will show many hits:
kglobalacceld high cpu usage

This bug found at KDE is interesting, as it originated in 2012 (yes, 2012), and the most recent feedback post is on 2024-11-02.

So, the issue is not uncommon, though I suspect it surfaces under specific conditions. (never experienced it on our machines).

https://bugs.kde.org/show_bug.cgi?id=306352

@myswtest
For me is not that obvious:

  • The bug status is fixed
  • The bug conditions are fare more specific that mines
  • Kglobalacceld is even necessary to reproduce the bug in my case
  • In my case is not only an issue of CPU usage
  • The other network hits that I of course look for before writting all this down neither looked helpful to me. But maybe it’s because I didn’t look well enough.

@aggie It’s a good idea. I was hoping to be able with everybody help to pin-point and fix the issue itself instead of brute-forcing it from scratch re-configuring everything. Also because I don’t remember all the changes I made to the system.

But in the bright side, almost all the changes made were system-wide (packages installation, nvidia drivers, flatpak, some of the scaling settigns…). But as we know those aren’t the cause of the issue I only need to remember user settings done into the system (themes, one-drive configuration and sync and whatever I’m not remembering right now).

So the problem is really the onedrive sync that took a few weeks by itself to complete and I don’t know if I can simply cp - a && chown -R the folder. Also that I don’t fully remember all the steps I did and the feeling that the problem with not reproduce and we will never know what it was :joy:

I will update here as soon as I’m able to reproduce it or I “finnish” the new user set up and it’s not reproduced. Even then, I still have hopes to understand what is happening here…

Hi guys,

I have created a new account and done all the personal configuration that needed to be done and worked successfully there for a few days without problem in wayland and X11. But still don’t know where the problem resides.

I tried to do meld /home/old/.config /home/new/.config (also for .local and similars) but is a haunting task. Any tips on how try to find the original problem? It has to forcefully be a user specific setting.

There is also the option to delete the old account and rename the new one, but I think that’s also a complicated thing to do as there is a lot of config that relies on username or the name of the home folder. I could do a global search and replace but still I don’t know if it’s something that can be done successfully or not…

Any input is welcomed!