After upgrading to Debian 11 bullseye (ksysguard 5.20.5), ksystemstats gets a major memory leak. It eventually gets resident memory in the GBs and matching swap, basically bringing the system to a halt from swapping. STEPS TO REPRODUCE 1. boot system 2. leave running 3. maybe suspend? it is a laptop OBSERVED RESULT EXPECTED RESULT Ever increasing memory usage, into the GBs SOFTWARE/OS VERSIONS Linux/KDE Plasma: debian 11 - Plasma 5.20.5 (available in About System) KDE Plasma Version: 5.20.5 KDE Frameworks Version: 5.78.0 Qt Version: 5.15.2
Created attachment 141081 [details] Valgrind log I can confirm this bug, leak was much worse on previous versions. Valgrind logs attached
Any chance you can do the same with heaptrack? We're seeing a huge heap usage: ==11108== HEAP SUMMARY: 936,250,898 bytes allocated so you're right something is going wrong, but the leak summary section doesn't have all that. So the bug leak during runtime is being cleaned up in the final destruction.
Created attachment 141130 [details] Heaptrack of newly reastarted program This is a heaptrack after the restart, but if I'm reading it correctly it has already leaked a bit in the minute it was running. I can connect it to the process when it begins to really leak, but given the amount of data it generates and how long it takes to trigger, I don't think i can let it run from now until then. Let me know if you can think of something else I can do. heaptrack output will be written to "/home/mikel/Downloads/heaptrack.ksystemstats.121644.gz" injecting heaptrack into application via GDB, this might take some time... injection finished heaptrack stats: allocations: 2680 leaked allocations: 20 temporary allocations: 365 removing heaptrack injection via GDB, this might take some time... ptrace: No such process. No symbol table is loaded. Use the "file" command. The program is not being run. Heaptrack finished! Now run the following to investigate the data:
Has this been fixed yet? Maybe just upstream? I'm running Debian-11 and the ksystemstats process is currently using 5 GB of memory. $ ps -o pid,args,pmem,rss,vsz -C ksystemstats PID COMMAND %MEM RSS VSZ 1799 /usr/bin/ksystemstats 36.7 5258904 5378280 I got a "System Monitor Sensor" widget/plasmoid in my plasma control bar. It's showing the memory consumption. And ironically this may seem to cause the memory leak. Duplicate reports: https://invent.kde.org/plasma/ksystemstats/-/issues/1 https://bbs.archlinux.org/viewtopic.php?id=263203 https://forum.manjaro.org/t/ksystemstats-memory-leak/39409/3 https://forums.debian.net/viewtopic.php?p=761527&sid=9600169c07a3f5aabf9f3d003e2c7346#p761527 https://unix.stackexchange.com/questions/679667/what-causes-ksystemstats-to-run-and-consume-many-gb-of-ram-how-to-prevent-this https://www.reddit.com/r/kde/comments/v5sg1q/workaround_for_this_memory_leak/
Is it possible this is related to bug 460370 as well? That one affects the new System Monitor.
Still not fixed $ ps -o pid,args,pmem,rss,vsz -C ksystemstats PID COMMAND %MEM RSS VSZ 1040153 /usr/bin/ksystemstats 25.0 3990380 28240352
ksysguard is no longer maintained, in Plasma 6 there is the Plasma system monitor for this task. If your issue still happens with the Plasma 6 replacement, please re-open and we can move this bug to the new product, thanks!