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 (https:/ /github.com/abraunegg/onedrive/)

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 general info: https:/ /hastebin.com/share/qupelayoda.yaml
  • System journal: https:/ /hastebin.com/share/xeyoxacidi.sql
  • User journal (bigger uptime than the one posted before): https:/ /hastebin.com/share/rozavonini.yaml
  • Plasmashell strace: https:/ /hastebin.com/share/oqaxihured.swift
  • Kglobalacceld strace: https:/ /hastebin.com/share/adavobigal.swift

Some of those files are heavily truncated due to maximum file size. If you want the full ones and have journalctl highlighting: https:/ /ufile.io/lnqxnww0

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!

PD: Due to being a new user I had to censor all the links here adding an space bettween the double slash https:/ /, sorry about that… Maybe a mod can fix that.

kglobalacceld is the global keyboard shortcut daemon, so based on that alone it looks to me like you added a custom keyboard shortcut and that’s broken. I’d try going to the keyboard shortcut settings, exporting the current shortcuts, resetting to default, rebooting the system and see if that solves the issue. If it doesn’t solve the issue, you can just import your shortcuts again and try something else, if it does work you can import your old shortcuts and do a little detective work to figure out which one is broken.

Edit: In your journal I found this

kded6[2423]: QDBusObjectPath: invalid path "/modules/plasma-session-shortcuts"
kded6[2423]: kf.dbusaddons: The kded module name "plasma-session-shortcuts" is invalid!

And here’s someone else who describes the desktop freezing and has the same lines in their log and they fixed it.

https://bbs.archlinux.org/viewtopic.php?id=297882

#QT_QPA_PLATFORMTHEME=“wayland;xcb” < I believe this was the problem
# GBM_BACKEND=nvidia-drm
# __GLX_VENDOR_LIBRARY_NAME=nvidia

these variables were added to try wayland before the explicit sync update for nvidia drivers and kde

Reference this post Plasmashell randomly goes to 100-120% CPU - #3 by soulnull

I’m not 100 its solved but no issues since commenting those variables out

Might be worth a shot?

Thanks for your answer.

I didn’t create any custom kb shortcut (just in case).

I’m not sure where should I need to modify those env variables.

hector@h-laptop-linux:~> grep -r QT_QPA_PLATFORMTHEME ~/.*
grep: /home/hector/.cache/flatpak/system-cache/summaries/flathub-x86_64-486cc1476c99ee711bc1a4ae41f8ba6185366399410c18fda6bef4524027edbc.sub: binary file matches
hector@h-laptop-linux:~> grep -r GBM_BACKEND ~/.*
hector@h-laptop-linux:~> grep -r __GLX_VENDOR_LIBRARY_NAME ~/.*
grep: /home/hector/.cache/flatpak/system-cache/summaries/flathub-x86_64-486cc1476c99ee711bc1a4ae41f8ba6185366399410c18fda6bef4524027edbc.sub: binary file matches

Also:

hector@h-laptop-linux:~> printenv QT_QPA_PLATFORMTHEME
hector@h-laptop-linux:~> printenv GBM_BACKEND
hector@h-laptop-linux:~> printenv __GLX_VENDOR_LIBRARY_NAME

So, if I’m not wrong seems like they are not set at all anywhere. Also the same guy in its own answer states that the solution was only temporal and that the real culprit was kdeidletime5, which I think I’m not getting any errors on the journal about it. May be worth reinstalling it even though?

does the same thing happen if you create a new user?

The way I read it, the kidletime5 thing was only a temporary fix and the environment variables is what they then edited afterwards instead. But I guess that doesn’t really matter when you didn’t have those variables set anyway.

imho it doesn’t make sense that it would be an issue with a package, since you said the issue does not come up when you create a new user. It must be a configuration thing.

Edit:

In the link that they referenced, there were other variables.

Maybe they had QT_QPA_PLATFORMTHEME and QT_QPA_PLATFORM confused?

Nope, see here:

Those aren’t set neither. It’s that normal?