Bug 433489 - Memory leak in plasmashell when switching desktop and Global Menu widget is present
Summary: Memory leak in plasmashell when switching desktop and Global Menu widget is p...
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Global Menu widget (other bugs)
Version First Reported In: 5.20.5
Platform: Manjaro Linux
: NOR normal
Target Milestone: 1.0
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-23 14:31 UTC by Igor
Modified: 2025-02-08 03:47 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor 2021-02-23 14:31:56 UTC
SUMMARY
I have been experiencing this for a long time. I think about a year for sure.

For a work session of 12 hours, plasmashell memory consumption can grow from ~100Mb to ~1GB.

Memory consumption increases irrevocably when switching virtual desktops. Approximately 300-400Kb at a time.

In the process of research I came across these closed reports with the same problem:
- https://bugs.kde.org/show_bug.cgi?id=391063
- https://bugs.kde.org/show_bug.cgi?id=368838

but researching it didn't help me a lot.

I have experienced this on at least two different machines. Also on different KDE desktop configurations, including on a fresh kde config for new user.

I have already tried removing the system monitoring applets. It didn't help.

STEPS TO REPRODUCE
Switch between virtual desktop with opened windows on them should be enough.


OBSERVED RESULT
Memory usage of plasmashell process continuously increases

EXPECTED RESULT
Stable memory usage of plasmashell

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro 20.2.1 

KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.15-1 MANJARO

ADDITIONAL INFORMATION
GPU: Intel HD Graphics 620

Video with the bug: https://youtu.be/MrVhHLO14u8
Comment 1 Alois Wohlschlager 2021-02-23 20:34:13 UTC
I cannot reproduce the leak. Could you please share the follwoing?
* Your wallpaper settings (image, color, world map, etc.)
* Do you have any plasmoids on the desktop, or a customized panel?
* Can you reproduce the bug always, or only under special circumstances (e.g. only after waiting 10 seconds, only after opening or cloing apps)?
Comment 2 Igor 2021-02-28 11:42:22 UTC
Sorry for the late answer.

Wallpaper settings:
  Layout: Folder view
  Wallpaper type: Image
  Positioning: Scaled and Cropped

Plasmoids and customized panels:
  On the standard panel, i have some plasmoids:
    - Window buttons 0.8.1-2 https://github.com/psifidotos/applet-window-buttons
    - Window title 0.6.0-1 https://github.com/psifidotos/applet-window-title
    - Window app menu 0.6.0 https://github.com/psifidotos/applet-window-appmenu
    - System Load Viewer 0.8 (default)
  
  In the process of research the problem I tried to disable applets one by one from the list above, but ram consumption was still growing.
  Also default KDE plasmoids I use:
    - System tray
    - Digital clock

  Additional Panel is Latte Dock with just icons.

Reproduce circumstances:
  It's truly hard to predict, when the problem actually appears. It happens, the problem appears just from system start. Sometimes after a while, but I can't tell you what trigger actually is. 

If I can do something to investigate it myself, I will, just show me the direction.

Thanks for the quick reply.
Sincerely.
Comment 3 Igor 2021-02-28 15:23:15 UTC
Today I got an update, and now KDE version is 5.21.1 and it just got worse.

Now memory usage is growing at minimize/maximize action. I've spend about 2 hours to investigate this situation, and now I'm about to sure, that the problem is in Global Menu widget.

I've repeat the experiment with removing widgets one by one, and noticed that memory usage stops growing after I:
1. Remove global menu widget from panel
2. Close "Widget removed" notification

It seems to me that notification is the key, why previous attempts was not successful.

The experiment above I did and with standard "Global Menu" applet (it requires to add menu button to window title bar) and with third-party "Window app menu".
Both has the same result, as described above.

This is very frustrating for me. Global menu is my favorite widget (in related with the two others), I don't want to give it up.
So for now I have no idea how it possible to bypass the situation, and just use 

plasmashell --replace & sudo swapoff -a && sudo swapon -a

when memory consumption is too high.
Comment 4 Igor 2021-02-28 15:36:16 UTC
Window buttons (https://github.com/psifidotos/applet-window-buttons) widget triggers this situation too.
Comment 5 Nate Graham 2025-01-09 21:18:21 UTC
Are you still able to reproduce the issue in Plasma 6.2.5 or later? Thanks!
Comment 6 Bug Janitor Service 2025-01-24 03:46:57 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Bug Janitor Service 2025-02-08 03:47:30 UTC
๐Ÿ›๐Ÿงน This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.