Bug 497041 - Very high memory usage while using external monitor connected directly to the laptop
Summary: Very high memory usage while using external monitor connected directly to the...
Status: RESOLVED DUPLICATE of bug 496469
Alias: None
Product: kwin
Classification: Plasma
Component: performance (show other bugs)
Version: 6.3.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, regression, wayland-only
Depends on:
Blocks:
 
Reported: 2024-12-04 15:46 UTC by enthusiastic_stayer
Modified: 2025-03-07 11:38 UTC (History)
6 users (show)

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


Attachments
htop output (438.69 KB, image/png)
2024-12-04 15:46 UTC, enthusiastic_stayer
Details
dmesg output after kernel out of memory: kwin-wayland got killed (29.33 KB, text/plain)
2024-12-09 17:36 UTC, fuxle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description enthusiastic_stayer 2024-12-04 15:46:49 UTC
Created attachment 176346 [details]
htop output

SUMMARY
I'm using EndeavourOS with KDE Plasma and Wayland Lenovo Thinkbook 16p Gen 4 with RTX 4060 Mobile as a discrete graphics card. I have two displays connected to the laptop via Lenovo USB-C dock Gen 2 and the third one is connected directly to the laptop. Displays connected via dock are both 60Hz while the third is capable of 144Hz(although I need to have it set to 120Hz otherwise this screen is blank despite system telling me it's on and working). The issue is when I play some videos (be it Youtube videos or google meetings) kwin_wayland process keeps eating more and more memory until it eats too much and gets killed by oom killer. Then I get logged out. 
What's more, during this memory hogging kwin_wayland spawns a lot of background processes.(screen from the htop in attachment).
I do not expect the issue to be "not enough resources" as I have i9-13900H with 32GBs of ram.
Today I've run a test where I was not putting any videos on main screen and after over 9 hours RAM usage was at about 10GBs of ram(it's normal based on workload).


STEPS TO REPRODUCE
1. Connect display to the port on the laptop
2. Run some videos on it
3. Watch as kwin_wayland gets it eat-as-much-as-you-want day.

OBSERVED RESULT
Ram usage on always-increasing level(memory leak?).

EXPECTED RESULT
RAM usage on reasonable level.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndeavourOS
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Nvidia driver installed: nvidia-dkms version 565.57.01-2
Kernel version: 6.12.1-arch1-1

ADDITIONAL INFORMATION
I'm more than happy to provide any more necessary info regarding this issue.
Comment 1 Conrad 2024-12-04 16:33:57 UTC
I am also seeing the same thing on a Lenovo Legion 7i with an Nvidia RTX 3060 running Archlinux with KDE Plasma. htop shows 76% memory usage from kwin_wayland after a zoom call when plugged into an external monitor. Probably the third time this has happened and is only resolved after a reboot.
Comment 2 fuxle 2024-12-09 17:34:57 UTC
I think I have the same Issue. I first discovered it about 3 or 4 weeks ago. Now today it happened again and I immediately gathered information. My issue sounds like the same mentioned in the Bug-Issue. 

I was streaming using OBS, about 10 min later it got laggy and a short moment later I got a black screen and was logged out. I'll attach my dmesg log, my system information are at the bottom of this comment. I was logged into the desktop the whole time, so I also send the uptime, maybe this helps.

$ uname -a
Linux mo-nb-gb 6.11.10-300.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Nov 23 00:51:20 UTC 2024 x86_64 GNU/Linux

$ uptime
18:18:41 up 21:46,  2 users,  load average: 1,07, 1,26, 1,44

Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.10-300.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: GIGABYTE
Product Name: A5 K1
Comment 3 fuxle 2024-12-09 17:36:35 UTC
Created attachment 176461 [details]
dmesg output after kernel out of memory: kwin-wayland got killed
Comment 4 Sriram 2024-12-14 09:10:15 UTC
Yep, same issue here and I am using a Lenovo Legion laptop with an Intel i9 CPU and NVIDIA RTX 4060 GPU. I can attach screenshots of htop if it helps.
Comment 5 therealchubbypanda 2025-03-05 13:57:36 UTC
This is also being discussed in the archlinux forums: https://bbs.archlinux.org/viewtopic.php?id=301440
Comment 6 therealchubbypanda 2025-03-05 13:58:50 UTC
Workaround:

1. Disconnect external monitor
2. Wait a few seconds
3. Reconnect external monitor
Comment 7 therealchubbypanda 2025-03-07 11:38:42 UTC
*** This bug has been marked as a duplicate of bug 496469 ***