SUMMARY When a window toggles full-screen many times, RAM usage attributed to kwin_wayland grows substantially. Rebooting or kwin_wayland --replace returns RAM usage to normal. Closing all windows does not. STEPS TO REPRODUCE 1. Open VLC, mpv, Firefox or any other program that can enter full-screen 2. Press the toggle full-screen button (usually F11 or 'f') exactly 16 times to observe the first memory leak and a lag spike 3. Leaving full-screen again (i.e. pressing toggle twice more) will leak much more memory each time OBSERVED RESULT Total RAM usage while testing with mpv looked like this: 1.7GiB to start, with video open and playing in a small window 16 full-screen toggles later: the first permanent increase to 1.9GiB Subsequent times leaving full-screen: 2.5, 4.8, 14.3 GiB (Going further exhausts my RAM entirely. Only holding the power button has any effect at that point.) Other runs: (kwin_wayland --replace) [1.7,(16 full-screen toggles...) 1.8, 2.4, 4.8, 14.3] GiB (and after a reboot) [1.7,(16 full-screen toggles...) 1.9, 2.5, 4.9, 14.4] GiB EXPECTED RESULT RAM usage should be stable when a window cycles full-screen any number of times SOFTWARE/OS VERSIONS Operating System: EndeavourOS KDE Plasma Version: 6.3.2 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 Kernel Version: 6.13.5-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 2600X Six-Core Processor Memory: 15.5 GiB of RAM Graphics Processor: AMD Radeon RX 580 Series ADDITIONAL INFORMATION Closing the window after step 2 will also result in a lag spike. Pressing alt+F4 before the 16th toggle avoids the problem, even if the window appears to leave full-screen for the problematic 8th time as it closes. The issue is per window. I can drag a new tab from Firefox out into its own new window and it has the full 16 toggle capacity, independent of its originating window. Another user has reported similar behaviour in coment 48 of bug id 496469; also an EndeavourOS user, but different hardware. All other methods of toggling full-screen are affected. I avoided double-clicking videos because counting single key-presses feels more precise. It is always the 16th toggle on my machine measured this way.
I can reproduce this. Repeatedly full-screening LibreWolf (a Firefox fork) and leaving full screen does indeed cause kwin_wayland's memory usage to rise and then not fall again.
I have upgraded my system and the problem is resolved, marking FIXED! Operating System: EndeavourOS KDE Plasma Version: 6.3.3 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 Kernel Version: 6.13.6-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 2600X Six-Core Processor Memory: 15.5 GiB of RAM Graphics Processor: AMD Radeon RX 580 Series Please check the above releases before reopening if you're still having trouble
Oops, I guess I had a few good days, but it's definitely back exactly as it was. Real headscratcher Operating System: EndeavourOS KDE Plasma Version: 6.3.3 KDE Frameworks Version: 6.12.0 Qt Version: 6.8.2 Kernel Version: 6.13.7-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 2600X Six-Core Processor Memory: 15.5 GiB of RAM Graphics Processor: AMD Radeon RX 580 Series
For what it's worth, I can't reproduce this on my Fedora KDE 41 device (NVIDIA graphics) or on a KDE Neon VM (QEMU, software rendering).