Bug 441551 - plasmashell leaks memory over time
Summary: plasmashell leaks memory over time
Status: RESOLVED UNMAINTAINED
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-performance (show other bugs)
Version: 5.20.5
Platform: Debian stable Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: efficiency
Depends on:
Blocks:
 
Reported: 2021-08-25 21:43 UTC by nurupo
Modified: 2022-03-02 04:35 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nurupo 2021-08-25 21:43:40 UTC
SUMMARY
Using Plasma for 7 days, I see plasmashell process RSS memory usage raise to around 2.5GiB.
Using Plasma for 30 days, I see plasmashell process RSS memory usage raise to around 6-8GiB.

STEPS TO REPRODUCE
1. Keep using your PC as usual, without powering it off for long time (e.g. a month)

OBSERVED RESULT
plasmashell memory usage keeps growing over time, totaling over 6GiB in RSS memory usage by the end of the month.

EXPECTED RESULT
plasmashell memory usage doesn't keep growing over time. Furthermore, it stays below 1GiB at all times.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian 11 (Bullseye), Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-3 (2021-07-28) x86_64 GNU/Linux
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Heaptrack of 7 days run (423MiB): https://pixeldrain.com/u/D8bPUCYW
SHA256: 10e9c9017bca95eaf4f3367a8ff95435d2895b8ed74136d6bf6e967066e29b67

I had to use the master branch of Heaptrack, commit 2a1e0710f489c2f7cceeceb671366eb9156958e0, because unlike the latest release v1.2.0, the master branch is able to find the detached debug symbols on Debian that are provided by the the *-dbgsym packages.

I suspect that the memory leak is due to my interaction with the Task Manager, as plasmashell's memory usage growth seems to be correlated with the times I actively use the Task Manager. I have 110 windows of one application open which are grouped under a single task and I access them rather often. I have noticed that plasmashell's memory usage grows when clicking on the grouped task in the Task Manager to pop-up the list of tasks and then mouse-overing the task list. One time I kept doing that over and over to confirm my suspicion, with each time plasmashell memory usage increasing by about 4MiB, stopping with my test when plasmashell's memory usage increase by 200MiB in total. Not sure if it matters, but some of those 110 windows have longer titles than others, taking up 2 lines in the task manager list pop-up, wile other are 1-line. I also replace maybe 70 out of 110 those windows each day: close 70 of them and open 70 new ones with new window titles.

Task Manager settings: Appearance: https://i.imgur.com/Gah5d5k.png
Task Manager settings: Behavior: https://i.imgur.com/R68WEAX.png

X11
Plasma Style: Opaquity https://www.opendesktop.org/p/998880/
Global Theme: Oxygen
Application Style: Oxygen
Window Decorations: Oxygen
Comment 1 MIchael Giardino 2021-09-16 22:00:14 UTC
I also have the same issue, though I don't have the same Task Manager (ab)use.
Comment 2 MIchael Giardino 2021-09-16 22:05:09 UTC
Sorry for the mostly useless confirmation. The behavior is quite similar and my system versions are the same (except for a slightly newer kernel):

Debian Bullseye 5.10.46-4 (2021-08-03) x86_64 GNU/Linux
KDE Plasma Version. 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 3 Quartz 2021-10-21 18:23:30 UTC
Bump x9. 

I'd appreciate if this bug takes priority - it might be causing other accidental threads being created in relation to memory leaks and mistaking side effects in other places (such as I did with plasma widgets).

It makes it impossible to keep a desktop linux distro running KDE for several days and it's making the desktop environment give a really poor impression and experience.
Comment 4 Matt Whitlock 2022-02-13 00:37:25 UTC
To all who are experiencing this issue, please retest with Plasma Frameworks 5.86.0 or newer.

https://invent.kde.org/frameworks/plasma-framework/-/commit/73782c8b39d1cc41fef003acca8df75ccdf384e4
Comment 5 Nate Graham 2022-02-14 15:37:25 UTC
.
Comment 6 Bug Janitor Service 2022-03-01 04:36:20 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
mark the bug 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 7 nurupo 2022-03-01 06:28:59 UTC
Sorry, Janitor bot, can't provide any info until the next Debian release, which definitely won't happen in 30 days.
Remind me in 1.5-2 years.

For the time being I do something like `pkill plasmashell && sleep 5 && plasmashell --replace &` to restart plasmashell when it grows too big.
Also, my usage pattern has changed, I don't interact with the Task Manager as much as I used to when reporting this bug, so it takes plasmashell longer to grow in size, so I have to restart it only every two weeks or so, which is manageable.
Comment 8 Nate Graham 2022-03-01 20:45:17 UTC
Then I guess there's nothing to do here, unfortunately. Plasma 20.04 is no longer supported, as it is neither the latest version nor a Long Term Support (LTS) version. Debian's packagers should maybe consider sticking to LTS versions in the future if their packaging policies preclude shipping the latest version.
Comment 9 Nate Graham 2022-03-01 21:27:24 UTC
Er, I mean, Plasma 5.20.4 is no longer supported. Darn version numbers!
Comment 10 nurupo 2022-03-02 04:35:38 UTC
Understandable, thanks for handling the issue.

>Debian's packagers should maybe consider sticking to LTS versions in the future if their packaging policies preclude shipping the latest version.
That wouldn't make a difference, as Stable precludes updating packages at all, unless it's a CVE patch. So even if Stable shipped with a LTS version of Plasma, it still wouldn't get updated.