SUMMARY So the VRAM usage leaks when repeatedly switching between window icons in the taskbar (I tested this with Konsole windows) I first noticed the issue when my RAM usage was unusually high on KDE 6 (so I checked radeontop and the GTT usage was over 3 GB which shouldn't happen in normal usage) So I did some testing and noticed that issue only happens in that scenario above (I did some more testing and noticed that disabling the 2 window options in Icons-only Task Manager prevents the VRAM leak) Hopefully this bug isn't Mesa-specific though (because I haven't tested a NVIDIA-only setup) STEPS TO REPRODUCE 1. Launch KWin Wayland 2. Make sure the 2 window options in Icons-only Task Manager are enabled 3. Open 2 Konsole windows (other apps should be fine too) 4. Hover over the 2 Konsole icons to generate the thumbnails 5. Click repeatedly between the 2 Konsole icons to switch between those Konsole windows (I think there's an unrelated segfault but the VRAM leak should be visible before then) OBSERVED RESULT The VRAM usage keeps growing with no limit (I managed to hit the 8 GB GTT limit) EXPECTED RESULT The VRAM usage should mostly stay the same SOFTWARE/OS VERSIONS Linux: 6.7.9-arch1-1 KDE Plasma Version: 6.0.2 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Mesa Version: 24.0.2 PipeWire Version: 1.0.3
Cannot reproduce on X11. Are you on Wayland?
(In reply to Fushan Wen from comment #1) > Cannot reproduce on X11. Are you on Wayland? I did mention Wayland in my issue report so definitely yes
I have this issue too, similar configuration, by following the steps I was able to get VRAM to jump from < 1gb to 2.5gb and RAM from ~300mb to 750mb (Though while trying to figure out the source I had it at 1gb+ before). Disabling hover thumbnail also prevents the leak for me. Integrated Radeon GPU on AMD 7 Pro 5850U Linux: 6.7.9-arch1-1 KDE Plasma Version: 6.0.2 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Wayland Version: 1.22.0-1 Mesa Version: 24.0.3
FWIW, I have two GPUs - RX570 (amdgpu) and 12900k integrated (i915), with one monitor connected to each gpu. When I start switching between konsole windows when both are present on the monitor connected to the amd gpu, the VRAM is not rising. But when I move both konsole windows to the monitor connected to the Intel gpu and start swithing windows then VRAM (on the *amdgpu* and also system RAM/GTT after a while) is rising rapidly. Disabling thumbnails indeed fixes the issue, thank you for the workaround.
I'm also encountering a memory leak when hovering over the applications in the status bar (not VRAM though). X11 (but probably wayland as well since I switched back to X11 after another unusable wayland issue). I'll be attaching screencaps of heaptrack's "Consumed" and "Top-Down" tabs. You'll notice the few areas in the chart where I intentionally hovered over each active application in the status bar back and forth several times, along with my time away from my computer (where there was no change). Is the thumbnail/preview being created and not cached or disposed of every time? Just cache it once for a given PID and dispose of it when the process terminates. My undesirable workaround for plasmashell as a whole is just to have it die by using "MemoryMax=600M" for the service, where it then just respawns fresh (though open applications in the statusbar may get rearranged each time). I used that for wayland too, but it was happening much more frequently (more than once a day vs probably a week+ on X11 before it dies), and it was worse for wayland because yesterday before I switched, plasmashell was stuck in a dying state and there were 2 processes open for it. I had to SIGKILL the earlier one.
Created attachment 168763 [details] Heaptrack Consumed
Created attachment 168764 [details] Heaptrack Top-Down