Bug 502240 - Memory leak that gets worse with 3rd-party theme
Summary: Memory leak that gets worse with 3rd-party theme
Status: RESOLVED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-performance (show other bugs)
Version: master
Platform: Arch Linux Linux
: NOR major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-31 13:07 UTC by 6R1M R34P3R
Modified: 2025-04-04 07:58 UTC (History)
5 users (show)

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


Attachments
btop showing plasmashell using 36G on the system (it then went up to 40G+) (223.71 KB, image/jpeg)
2025-03-31 13:07 UTC, 6R1M R34P3R
Details
heaptrack (902.79 KB, application/zstd)
2025-04-01 09:39 UTC, 6R1M R34P3R
Details
heaptrack (904.74 KB, application/zstd)
2025-04-01 09:40 UTC, 6R1M R34P3R
Details
heaptrack (901.82 KB, application/zstd)
2025-04-01 09:40 UTC, 6R1M R34P3R
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 6R1M R34P3R 2025-03-31 13:07:17 UTC
Created attachment 179883 [details]
btop showing plasmashell using 36G on the system (it then went up to 40G+)

SUMMARY


STEPS TO REPRODUCE
1. Run plasmashell under Wayland
2.  Launch btop to check plasmashell RAM usage
3. Wait a few minutes 
OBSERVED RESULT

plasmashell procces rapidly increases RAM usage and have 20GB+ been used on my 64GB (real memory) machine with also 64GB disk swap in 3 minutes average
it sometimes has even reached 48GB, and others all the RAM and plasmashell restarts itself, killing all my apps in the procces. There is no need to run anything else, it always eats all the RAM
I have also removed all plasmoids as that seems to be normal cause of memory leaks
But still the same
My KDE Plasma Wayland environment is very vanilla

EXPECTED RESULT

plasmashell using normal and average expected RAM
 
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: latest
KDE Frameworks Version: latest
Qt Version: latest

ADDITIONAL INFORMATION

I have tried running this command in case it could somehow help
Please let me know how to do better, as I have never encountered an issue like this before

https://pastebin.com/qgxN3Puu
Comment 1 duha.bugs 2025-03-31 15:30:09 UTC
Do you get memory leaks with the default Breeze theme?
Comment 2 Michael Butash 2025-03-31 15:48:23 UTC
I've had bug 471642 open since 5.27 for the same sort of leak, and as of 6.3 its still there, and probably worse. I've provided heapstacks for review of memory usage at the time, but nothing has come of it. You'll probably want to install heapstack as well at high memory and provide for the devs.
Comment 3 6R1M R34P3R 2025-03-31 16:24:11 UTC
Okay guys
I THINK i have found the issue
And I say I THINK because I have tried many things and Im not yet sure what the issue is and sometimes it has returned etc
but I can now mantain it at least for now at around 600-900 MiB after 10 minutes time elapsed normal use by removing my Walpapers. I think it was specifically the Walpaper Presentation plugin, but as of writing this Im yet figuring out what happens and if that indeed is the problem or not. Kind of frustrated trying to fix this but thanks to the 2 replies. I'm gonna do some more reboots/relogins putting on/off that feature to check. Hopefully I have found the source of the issue. Otherwise, I really don't know what it is, I have even tried removing taskbars
Comment 4 6R1M R34P3R 2025-03-31 16:28:57 UTC
(In reply to Michael Butash from comment #2)
> I've had bug 471642 open since 5.27 for the same sort of leak, and as of 6.3
> its still there, and probably worse. I've provided heapstacks for review of
> memory usage at the time, but nothing has come of it. You'll probably want
> to install heapstack as well at high memory and provide for the devs.

can you help me? I have installed it but i dont quite get how to use it
the GUI confuses me as there is many things I don't get
Comment 5 Michael Butash 2025-03-31 16:41:03 UTC
What I'd done was attached it using the pid of the plasmashell using "heaptrack --pid $pid", then when at high memory, kill -9 said pid and plasmashell should restart, and heaptrack should spit out a file and launch in analyze mode.
Comment 6 Nate Graham 2025-03-31 20:40:53 UTC
> Walpaper Presentation plugin

Is that a 3rd-party wallpaper plugin you installed? Or a translation of the built-in "Slideshow" wallpaper that shows different images of your choosing?
Comment 7 6R1M R34P3R 2025-04-01 09:26:32 UTC
(In reply to Nate Graham from comment #6)
> > Walpaper Presentation plugin
> 
> Is that a 3rd-party wallpaper plugin you installed? Or a translation of the
> built-in "Slideshow" wallpaper that shows different images of your choosing?

I have my system set to Spanish, but yes, this refers to the built-in slideshow feature.

I’ve noticed that disabling the slideshow and switching back to a static wallpaper significantly slowed down the memory leak. Previously, plasmashell would reach around 20GB of RAM usage within just three minutes. After disabling the slideshow, it took about an hour to reach 9GB, indicating a much slower leak.

Switching back to the default Breeze theme completely stopped the leak. I was able to leave my system running for 13 hours with plasmashell maintaining a stable usage of around 800 MiB.

Now, I’ve reapplied my usual theme, (Shades of Purple)[https://store.kde.org/p/2090553], but only as a Global Theme to check if the issue persists. As of writing this, with the theme enabled, plasmashell is using 946 MiB after 13 minutes. The memory usage is slowly increasing again, suggesting that the leak might still be present.

I’ve also collected logs with heaptrack and will share them later once I confirm whether the leak continues with this theme.
Comment 8 6R1M R34P3R 2025-04-01 09:39:40 UTC
Created attachment 179906 [details]
heaptrack

heaptrack
Comment 9 6R1M R34P3R 2025-04-01 09:40:27 UTC
Created attachment 179907 [details]
heaptrack

heaptrack
Comment 10 6R1M R34P3R 2025-04-01 09:40:58 UTC
Created attachment 179908 [details]
heaptrack

heaptrack
Comment 11 6R1M R34P3R 2025-04-01 09:41:32 UTC
Alright, definitely this theme provokes a memory leak, I was back again at 1.0GiB usage after 26mins, I have changed back to Breeze Dark and it went back to 962MiB and Ill keep an eye to see if it stays stable for long, will update on this.

For now, here are some heaptracks logs of different times. Sorry, I didn't named them accordingly for better organized tracking and some are from more memory usage than others etc. Also, I have some of 10MiB that I can't upload here
Comment 12 6R1M R34P3R 2025-04-01 09:45:48 UTC
Default Breeze theme is now leaking memory, too, but very slowly
Yesterday it wasn't as I said i was able to run it for 13 hours at 800MiB
Comment 13 Méven 2025-04-04 07:58:17 UTC
For reference heaptrack instructions were at https://discuss.kde.org/t/high-memory-usage-from-plasmashell-is-it-a-memory-leak/29105/9

And this is being discussed in https://discuss.kde.org/t/plasmashell-using-40-gb-ram/32282/9

If there is a mem-leak in plasma with breeze, you can use the same heaptrack technique to diagnose it, it should probably be a new bug with an important priority, since breeze is the most commonly used theme.

In your traces, I could identify a leak in libEGL and libEGL_nvidia...
Both of which aren't maintained in plasma.