Bug 482483 - Gentoo/Nvidia proprietary driver & plasmashell constantly growing in RAM usage until oom killer kicks in
Summary: Gentoo/Nvidia proprietary driver & plasmashell constantly growing in RAM usag...
Status: RESOLVED DUPLICATE of bug 480693
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-performance (show other bugs)
Version: master
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-05 18:34 UTC by unhappy-ending
Modified: 2024-05-06 20:40 UTC (History)
3 users (show)

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


Attachments
plasmashell-16gb (31.51 KB, image/jpeg)
2024-03-05 20:21 UTC, unhappy-ending
Details
plasmashell-massif-graph (345.44 KB, image/png)
2024-03-06 01:29 UTC, unhappy-ending
Details
plasmashell-massif-evaluations (813.40 KB, image/png)
2024-03-06 01:30 UTC, unhappy-ending
Details
plasmashell-massif-allocators (78.96 KB, image/png)
2024-03-06 01:30 UTC, unhappy-ending
Details
plasmashell-massif-output (205.88 KB, text/plain)
2024-03-06 01:30 UTC, unhappy-ending
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unhappy-ending 2024-03-05 18:34:21 UTC
SUMMARY

I'm having a problem with Plasma 6 GIT wayland session on a Gentoo system, Xanmod kernel 6.7.7 custom config (I've also tested it on the default gentoo-kernel-bin kernel, same issue) and Nvidia drivers. I can't figure out why, but the plasmashell process continues to increase RAM usage until systemd's oom killer kicks in. Switching the SceneGraphBackend over to software seems to fix the issue, but that also introduces a bunch of other problems.

I've tried a brand new user with an untouched home directory and the issue still persists.
I've tried a different default, stock kernel, problem still persists.

I have not tried an X session, as I don't have xorg-server installed.

STEPS TO REPRODUCE
1. Have my particular PC
2. Upgrade from Plasma 5 to Plasma 6
3. Watch plasmashell process continue to eat up RAM

EXPECTED RESULT

plasmashell to not grow in RAM usage little by little in an empty session until oom killer kills it.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Xanmod 6.7.7
(available in About System)
KDE Plasma Version: 6.0.80 dev
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION

Outside of recompiling my system with debug symbols, what else can I do to try to help troubleshoot this?
Comment 1 unhappy-ending 2024-03-05 20:21:41 UTC
Created attachment 166436 [details]
plasmashell-16gb

I've compiled in X11 support and the xorg-server. Started up a fresh user with a new X11 session and the same issue is happening.

Including a screenshot of the wayland session using 18 gb of RAM.
Comment 2 fanzhuyifan 2024-03-05 21:44:37 UTC
I know Gentoo supports custom compile flags and such. Does this also happen with a "standard" compile of plasmashell?

Also some sort of heap profile result of plasmashell would be extremely helpful

https://stackoverflow.com/questions/4690800/how-to-profile-memory-usage
https://stackoverflow.com/questions/700097/memory-allocation-profiling-in-c
Comment 3 unhappy-ending 2024-03-05 23:20:49 UTC
(In reply to fanzhuyifan from comment #2)
> I know Gentoo supports custom compile flags and such. Does this also happen
> with a "standard" compile of plasmashell?
> 
> Also some sort of heap profile result of plasmashell would be extremely
> helpful
> 
> https://stackoverflow.com/questions/4690800/how-to-profile-memory-usage
> https://stackoverflow.com/questions/700097/memory-allocation-profiling-in-c

I was looking into Valgrind prior to making this post and will attempt it when I get some time. I am going to try an uncustomized USE flag setting for KDE and Qt, and see if there is any change, and then move on to looking into Valgrind.
Comment 4 unhappy-ending 2024-03-06 01:29:27 UTC
Created attachment 166453 [details]
plasmashell-massif-graph
Comment 5 unhappy-ending 2024-03-06 01:30:01 UTC
Created attachment 166455 [details]
plasmashell-massif-evaluations
Comment 6 unhappy-ending 2024-03-06 01:30:27 UTC
Created attachment 166456 [details]
plasmashell-massif-allocators
Comment 7 unhappy-ending 2024-03-06 01:30:53 UTC
Created attachment 166457 [details]
plasmashell-massif-output
Comment 8 unhappy-ending 2024-03-06 01:33:18 UTC
I started up a new session and ran valgrind --tool=massif --massif-out-file=/home/timothy/massif.out.plasma6 plasmashell --replace
to collect some data for massif-visualizer. I included some screenshots of the data for a quick glance and the actual file to load up in massif-visualizer. Please let me know if there is anymore information you need, I will try my best to provide it.
Comment 9 unhappy-ending 2024-03-27 19:10:42 UTC
As of Plasma 6.0.2 and kernel version 6.8.1 I can't reproduce this anymore. I don't know if it had to do with a kernel config change, the new kernel itself, the update to wayland-protocols and egl-wayland supporting explicit sync or something else.
Comment 10 fanzhuyifan 2024-03-27 19:14:53 UTC
(In reply to unhappy-ending from comment #9)
> As of Plasma 6.0.2 and kernel version 6.8.1 I can't reproduce this anymore.
> I don't know if it had to do with a kernel config change, the new kernel
> itself, the update to wayland-protocols and egl-wayland supporting explicit
> sync or something else.

Thanks for all the info!

Looking at the profiling data this might be an issue in nvidia driver version 550.54.14.

Given that you can no-longer reproduce this in the latest version let's call this resolved-upstream for now.
Comment 11 unhappy-ending 2024-05-05 12:23:14 UTC
Hi, sorry to reopen this. I found out what triggers it. It's when slide show is enabled as the desktop background. As each image changes to the next, the memory usage goes up until it runs out and plasma crashes. I noticed it because I had set the image to change every 2 seconds (I was testing something else out) so it was easy to watch my memory widget go up every 2 seconds. Changing the background to something else like a plain color stops the memory from going up, but the memory also doesn't free itself.

Wallpaper type Image is fine, but as I select a different image to decide which I want, the memory goes up for each one I click. I can keep doing this until I get an OOM and plasmashell crashes and restarts or OOM killer kicks in.

I can even trigger this using Picture of the Day, and once each image is downloaded from each source, changing between the sources at random will increase the memory even when returning to an image that was once loaded.

In addition to the info below, I also  use a dual monitor setup with one scaled to 4k@150% and the other 1080p@75%. This current system is compiled with clang but also happened on a GCC compiled system which I was using when I first submitted the report.

Operating System: Gentoo Linux 2.15
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.7-clang (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 3950X 16-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3070/PCIe/SSE2
Product Name: X570S PG Riptide
Comment 12 Nate Graham 2024-05-06 20:40:19 UTC
Ok, that makes it the same as Bug 480693. Thank for following up.

Since you seem very technically capable, it would be amazing if you wanted to investigate the issue further and look into fixing it!

*** This bug has been marked as a duplicate of bug 480693 ***