SUMMARY plasmashell process has a constantly growing memory footprint on my system. I believe that it has something to do with the Nvidia driver, but I'm not sure. I noticed this quite a long time ago (5.15-5.18 or earlier, I don't know). This machine runs Debian Sid with Plasma packages from experimental (currently 5.21.5) and has an Nvidia GTX 660 graphics card using the proprietary driver (version 460.73.01). A really good example: - Here is a screenshot from 13 April 2021 19:28:54 CEST, a bit after starting plasmashell: https://grzesiek11.stary.pc.pl/files/images/Screenshot_20210413_192854.png - Now, a screenshot from 14 April 2021 15:40:52 CEST (~24h later): https://grzesiek11.stary.pc.pl/files/images/Screenshot_20210414_154049.png - Memory details from KSysGuard from about the same time: https://grzesiek11.stary.pc.pl/files/images/Screenshot_20210414_154025.png - Finally, after restarting plasmashell: https://grzesiek11.stary.pc.pl/files/images/Screenshot_20210414_154220.png This was a test done on 5.21.4 (last month), I kept my PC on for 2 workdays and a night. However, I experience this during my normal workday on 5.21.5, with smaller memory values obviously (it grows to around 300-400 MB instead of 800 MB, so it's pretty consistent (~2x smaller for ~2x less time)). I have another machine, a Thinkpad x240 with Intel iGPU (the same distro, the same Plasma packages). It had over a month of uptime (with sleep, so a it's bit of cheating I guess) without restarting plasmashell when I was rebooting it to apply a kernel update. The memory usage was at ~150 MB, the same as right after starting plasmashell. STEPS TO REPRODUCE 1. Get a GTX 660 (I have no idea about other Nvidia cards, I don't have any. I don't even know if it happens on all 660s). 2. Install Debian Sid (I am using the experimental repo for Plasma, but I was experiencing the same on plain Sid versions, and I think even Stable). 3. Restart plasmashell, note its memory footprint. 4. Wait (I think it's noticable (~50-100 MB) after an hour, you can wait a day if you want to achieve the same results as shown above). 5. Note the memory footprint of plasmashell. OBSERVED RESULT The memory footprint stays about the same. EXPECTED RESULT The memory footprint grows to really high values. SOFTWARE/OS VERSIONS Operating System: Debian GNU/Linux 11 (Sid) KDE Plasma Version: 5.21.5 (any "recent" version is broken for me; I have chosen 5.21.4 because 5.21.5 is not on the list yet) KDE Frameworks Version: 5.81.0 Qt Version: 5.15.2 Kernel Version: 5.11.0-19.1-liquorix-amd64 (using vanilla Debian kernel doesn't change anything) OS Type: 64-bit Graphics Platform: X11 Processors: 4 × Intel® Core™ i5-2400 CPU @ 3.10GHz Memory: 7.7 GiB of RAM Graphics Processor: GeForce GTX 660/PCIe/SSE2 (MSI GeForce GTX660 TWINFROZR III) Nvidia Driver Version: 460.73.01 (as with KDE Plasma Version) ADDITIONAL INFORMATION --
Hi! I can't see such a drastic increase in plasmashell memory usage, however that might be due to different nvidia driver version. Still, it could just be something else than the graphics driver. Would it be possible for you to run plasmashell under valgrind? You need debug info for plasmashell and libraries to get usable results.
(In reply to Jiri Palecek from comment #1) > Hi! > > I can't see such a drastic increase in plasmashell memory usage, however > that might be due to different nvidia driver version. Still, it could just > be something else than the graphics driver. > > Would it be possible for you to run plasmashell under valgrind? You need > debug info for plasmashell and libraries to get usable results. I upgraded to KDE Plasma 5.22.1, Nvidia driver 460.84 and kernel 5.12.0 yesterday to check if the problem still occurs before replying to you, but now, after around 10h of uptime, plasmashell memory usage still sits at about 140 MB. So, I consider this to be resolved. Marking as "fixed", but I'm not sure if was Plasma, since I upgraded everything at once.
It's not fixed. Turns out a lot of waiting isn't guaranteed to trigger this issue. Here is the Valgrind report: https://grzesiek11.stary.pc.pl/files/texts/436900_valgrind.log (~80 MiB, be warned). I have no idea if I had done this right, I just copy-pasted the command found on the Wiki ('valgrind --leak-check=full --show-reachable=yes --track-origins=yes --trace-children=yes --log-file=plasmashell.log plasmashell') and left it overnight. plasmashell became very slow and unresponsive (which I guess is how Valgrind works), so I didn't use it at all and started everything from Konsole (that was not started by plasmashell, so it wouldn't be it's child). I don't know if I reproduced the issue, since Valgrind replaces the plasmashell process and it used 1.1 GiB at start (it grew to 1.7 GiB when I stopped it).
(In reply to Grzesiek11 from comment #3) > Here is the Valgrind report: > https://grzesiek11.stary.pc.pl/files/texts/436900_valgrind.log (~80 MiB, be > warned). Thank you. 80Mb, that's nothing :). Even emacs loads it. > I have no idea if I had done this right, I just copy-pasted the command > found on the Wiki ('valgrind --leak-check=full --show-reachable=yes > --track-origins=yes --trace-children=yes --log-file=plasmashell.log > plasmashell') and left it overnight. That's good, only the backtraces stop just short before showing useful info, so I'd like you to do it again. For the command: - --trace-children=yes is unnecessary, I don't think this has anything to do with children, and also, it prevents valgrind from tracing chromium ;) - --track-origins=yes does nothing for leaks However, I'd like you to add --num-callers=30, because some of the stack traces are too shallow, they don't go beyond the nvidia driver. So the command should be: valgrind --leak-check=full --show-reachable=yes --num-callers=30 --log-file=plasmashell.log plasmashell However, most of all, to get useful backtraces, you need the debugging infos for all the executables. The most suspicious for me is this record: ==103236== 28,516,944 bytes in 4 blocks are possibly lost in loss record 54,997 of 54,997 ==103236== at 0x483877F: malloc (vg_replace_malloc.c:307) ==103236== by 0x625404D: QImageData::create(QSize const&, QImage::Format) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2) ==103236== by 0x625426A: QImage::QImage(QSize const&, QImage::Format) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2) ==103236== by 0x62BFBFF: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2) ==103236== by 0x6274B18: QImageReader::read(QImage*) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2) ==103236== by 0x6275294: QImageReader::read() (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2) ==103236== by 0x625E3A7: QImage::fromData(unsigned char const*, int, char const*) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2) ==103236== by 0x6225523: QInternalMimeData::retrieveData(QString const&, QVariant::Type) const (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2) ==103236== by 0x6A6198F: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2) ==103236== by 0x6A627B8: QMimeData::imageData() const (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2) ==103236== by 0x259CB337: ??? (in /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/dataengine/plasma_engine_clipboard.so) ==103236== by 0x259BA854: ??? (in /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/dataengine/plasma_engine_clipboard.so) but 0x259CB337: ??? (in /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/dataengine/plasma_engine_clipboard.so) doesn't tell me much. To get debug symbols, since you're on debian, follow these instructions: https://wiki.debian.org/HowToGetABacktrace, mostly the part "Installing the debugging symbols". Particular debugging packages you need are: - plasma-workspace-dbgsym for plasmashell and plasma_engine_clipboard.so - libkf5plasmaquick5-dbgsym for libKF5PlasmaQuick.so.5.83.0 - libkf5plasma5-dbgsym for libKF5Plasma.so.5.83.0 and maybe - libqt5core5a-dbgsym - libqt5quick5-dbgsym - libqt5qml5-dbgsym > plasmashell became very slow and unresponsive (which I guess is how Valgrind > works), Sadly that's the way it is. > so I didn't use it at all and started everything from Konsole (that > was not started by plasmashell, so it wouldn't be it's child). I don't know Please try to interact with plasma as usual. The leak might be tied to some user actions. Or alternatively, think what could be contributing to the problem so it can be reproduced. If it is tied to the clipboard, do you use it specifically? Do you use some special widgets? etc. > if I reproduced the issue, since Valgrind replaces the plasmashell process > and it used 1.1 GiB at start (it grew to 1.7 GiB when I stopped it). Yeah that's OK, valgrind uses a lot for its bookkeeping.
(In reply to Jiri Palecek from comment #4) > That's good, only the backtraces stop just short before showing useful info, > so I'd like you to do it again. [...] Okay, I installed more debug symbols, adjusted the Valgrind args and here is the result: https://grzesiek11.stary.pc.pl/files/texts/436900_valgrind_2.log It's half a GiB this time... Hopefully my server can handle it. > Please try to interact with plasma as usual. The leak might be tied to some > user actions. This time I used it normally, it was workable since it didn't trace children. I also left it for one night. > Or alternatively, think what could be contributing to the > problem so it can be reproduced. If it is tied to the clipboard, do you use > it specifically? Do you use some special widgets? etc. My setup is pretty vanilla, so I don't know what could be the problem. I have bigger than default clipboard history (1000 entries), but clearing it only sets me back a couple of MiB in terms of memory usage. Hopefully it will be possible to figure it out from the log.
Hello and thank you again for the bug report! Unfortunately we were not able to address it yet, nor even manage to reproduce the issue ourselves. Can we ask you to please check if this issue is still happening with Plasma 5.27? If it is, please change the status to REPORTED. Thanks a lot!
Hi, I actually have a session of Plasma 5.27 up for over 20 days now on this exact machine and configuration, and it's memory usage is at a steady 700 MiB! I actually forgot about this bug report, since I don't have any issues with memory usage now. So, for whatever reason, this is now fixed. Great! My current system information, for reference: Operating System: Debian GNU/Linux 12 KDE Plasma Version: 5.27.7 KDE Frameworks Version: 5.107.0 Qt Version: 5.15.10 Kernel Version: 6.4.0-4-amd64 (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 2600 Six-Core Processor Memory: 15.6 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 660/PCIe/SSE2 Manufacturer: Gigabyte Technology Co., Ltd. Product Name: B450M DS3H Nvidia Driver Version: 470.199.02