You are not logged in.
Pages: 1
Hey people,
i have found an odd issue for me. Apparently, when i connect my Laptop to a second monitor and play or just doing stuff, over time my laptop freezes and can't operate anymore. As i monitored the issue, it seems Wayland is getting more loaded into my ram and at a point my ram and swap is full. Does anyone know how this can happen or does have the same issue.
- I'm using KDE Plasma
- Wayland goes up to 8GB RAM
- Problem doesnt occur when not using a second monitor
It would be nice if someone knows could be the issue.
Offline
Hmm that is indeed a lot of Kwin processes. It would be useful to know what process is spawning all of these. Can you try:
ps -o pid,ppid,cmd -p $(pgrep Kwin_wayland)
or make sure you replace Kwin_wayland with whatever the appropriate command is (I'm not sure since I don't use it).
Can you also share your boot logs from the most recent boot, and try disconnecting and re-connecting the monitor and share the output of dmesg so we can see if it spawns any weird messages?
Last edited by pvtvega (2024-12-02 17:50:22)
Offline
I am having the same issue, I'll leave the logs you asked to OP.
ps command:
PID PPID CMD
919 873 /usr/bin/kwin_wayland_wrapper --xwayland
924 919 /usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayland-fd 9 --xwayland-display :1 --xwayland-xauthority /run/user/1000/xauth_dHLNic --xwayland
latest boot log:
[ OK ] Found device WD PC SN810 SDCPNRY-512G-1006 2.
[ OK ] Found device WD PC SN810 SDCPNRY-512G-1006 1.
Activating swap /dev/disk/by-uuid/0b8e3b8a-1b12-4ccc-8359-067a7421bc0a...
Starting File System Check on /dev/disk/by-uuid/1797-E4EB...
[ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
[ OK ] Stopped Virtual Console Setup.
Stopping Virtual Console Setup...
Starting Virtual Console Setup...
[ OK ] Activated swap /dev/disk/by-uuid/0b8e3b8a-1b12-4ccc-8359-067a7421bc0a.
[ OK ] Reached target Swaps.
[ OK ] Finished Virtual Console Setup.
[ OK ] Finished File System Check on /dev/disk/by-uuid/1797-E4EB.
[ OK ] Started Show Plymouth Boot Screen.
[ OK ] Started Forward Password Requests to Plymouth Directory Watch.
[ OK ] Reached target Local Encrypted Volumes.
[ OK ] Reached target Path Units.
Starting Load/Save RF Kill Switch Status...
Starting Load Kernel Module dm_mod...
Starting Load Kernel Module loop...
[ OK ] Started Load/Save RF Kill Switch Status.
[ OK ] Finished Load Kernel Module dm_mod.
[ OK ] Finished Load Kernel Module loop.
[ OK ] Created slice Slice /system/systemd-backlight.
Starting Load/Save Screen Backlight Brightness of backlight:intel_backlight...
[ OK ] Reached target Sound Card.
[ OK ] Finished Load/Save Screen Backlight Brightness of backlight:intel_backlight.
Mounting /boot/efi...
Mounting Temporary Directory /tmp...
[ OK ] Mounted Temporary Directory /tmp.
[ OK ] Mounted /boot/efi.
[ OK ] Reached target Local File Systems.
[ OK ] Listening on Boot Entries Service Socket.
[ OK ] Listening on System Extension Image Management.
Starting Tell Plymouth To Write Out Runtime Data...
Starting Set Up Additional Binary Formats...
Starting Create System Files and Directories...
Mounting Arbitrary Executable File Formats File System...
[ OK ] Mounted Arbitrary Executable File Formats File System.
[ OK ] Finished Set Up Additional Binary Formats.
[ OK ] Finished Tell Plymouth To Write Out Runtime Data.
[ OK ] Finished Create System Files and Directories.
Starting Network Time Synchronization...
Starting Record System Boot/Shutdown in UTMP...
[ OK ] Finished Record System Boot/Shutdown in UTMP.
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Time Set.
[ OK ] Finished Load Kernel Modules.
Starting Apply Kernel Variables...
[ OK ] Finished Apply Kernel Variables.
[ OK ] Reached target System Initialization.
[ OK ] Started Refresh existing PGP keys of archlinux-keyring regularly.
[ OK ] Started Daily man-db regeneration.
[ OK ] Started Daily verification of password and group files.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Timer Units.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Listening on GnuPG network certificate management daemon for /etc/pacman.d/gnupg.
[ OK ] Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers) for /etc/pacman.d/gnupg.
[ OK ] Listening on GnuPG cryptographic agent and passphrase cache (restricted) for /etc/pacman.d/gnupg.
[ OK ] Listening on GnuPG cryptographic agent (ssh-agent emulation) for /etc/pacman.d/gnupg.
[ OK ] Listening on GnuPG cryptographic agent and passphrase cache for /etc/pacman.d/gnupg.
[ OK ] Listening on GnuPG public key management service for /etc/pacman.d/gnupg.
[ OK ] Listening on OpenSSH Server Socket (systemd-ssh-generator, AF_UNIX Local).
[ OK ] Listening on Hostname Service Socket.
[ OK ] Reached target Socket Units.
Starting D-Bus System Message Bus...
[ OK ] Started D-Bus System Message Bus.
[ OK ] Reached target Basic System.
Starting Network Manager...
Starting Bluetooth service...
Starting kdumpst loader boot-time service...
Starting Initialize hardware monitoring sensors...
Starting User Login Management...
Starting Waydroid Container...
[ OK ] Finished Initialize hardware monitoring sensors.
[ OK ] Started Bluetooth service.
[ OK ] Reached target Bluetooth Support.
Starting Hostname Service...
[ OK ] Started User Login Management.
[ OK ] Finished kdumpst loader boot-time service.
[ OK ] Started Hostname Service.
Starting Network Manager Script Dispatcher Service...
[ OK ] Started Network Manager Script Dispatcher Service.
[ OK ] Started Waydroid Container.
[ OK ] Started Network Manager.
[ OK ] Reached target Network.
Starting Permit User Sessions...
[ OK ] Finished Permit User Sessions.
Starting Hold until boot process finishes up...
Starting Terminate Plymouth Boot Screen...
dmesg output for disconnection and reconnection of the external monitors (I use a dock station so a lot of disconnections appear)
[Dec 6 03:21] usb 3-4: USB disconnect, device number 4
[ +0.000006] usb 3-4.3: USB disconnect, device number 5
[ +0.034288] usb 4-4: USB disconnect, device number 2
[ +0.000006] usb 4-4.4: USB disconnect, device number 3
[ +0.000001] usb 4-4.4.2: USB disconnect, device number 4
[ +0.000002] r8152-cfgselector 4-4.4.2.1: USB disconnect, device number 5
[ +0.000135] r8152 4-4.4.2.1:1.0 eth0: Tx status -108
[ +0.000005] r8152 4-4.4.2.1:1.0 eth0: Tx status -108
[ +0.000002] r8152 4-4.4.2.1:1.0 eth0: Tx status -108
[ +0.000029] r8152 4-4.4.2.1:1.0 eth0: Tx status -108
[ +0.004555] usb 3-4.4: USB disconnect, device number 6
[ +0.000011] usb 3-4.4.2: USB disconnect, device number 7
[ +0.000004] usb 3-4.4.2.2: USB disconnect, device number 10
[ +0.118687] usb 3-4.4.2.3: USB disconnect, device number 11
[ +0.073234] usb 3-4.4.3: USB disconnect, device number 8
[Dec 6 03:22] usb 4-4: new SuperSpeed USB device number 6 using xhci_hcd
[ +0.012331] usb 4-4: New USB device found, idVendor=8087, idProduct=0b40, bcdDevice=12.34
[ +0.000012] usb 4-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ +0.000005] usb 4-4: Product: USB3.0 Hub
[ +0.000004] usb 4-4: Manufacturer: Intel Corporation.
[ +0.001926] hub 4-4:1.0: USB hub found
[ +0.000233] hub 4-4:1.0: 4 ports detected
[ +0.759298] usb 3-4: new high-speed USB device number 12 using xhci_hcd
[ +0.123271] usb 3-4: New USB device found, idVendor=1d5c, idProduct=5801, bcdDevice= 1.01
[ +0.000006] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ +0.000002] usb 3-4: Product: USB2.0 Hub
[ +0.000001] usb 3-4: Manufacturer: Fresco Logic, Inc.
[ +0.000952] hub 3-4:1.0: USB hub found
[ +0.000027] hub 3-4:1.0: 4 ports detected
[ +0.061901] usb 4-4.4: new SuperSpeed USB device number 7 using xhci_hcd
[ +0.011491] usb 4-4.4: New USB device found, idVendor=03f0, idProduct=3488, bcdDevice= 6.25
[ +0.000006] usb 4-4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ +0.000001] usb 4-4.4: Product: USB7206 Smart Hub
[ +0.000001] usb 4-4.4: Manufacturer: Microchip
[ +0.001001] hub 4-4.4:1.0: USB hub found
[ +0.000025] hub 4-4.4:1.0: 5 ports detected
[ +0.273361] usb 4-4.4.2: new SuperSpeed USB device number 8 using xhci_hcd
[ +0.011330] usb 4-4.4.2: New USB device found, idVendor=03f0, idProduct=5488, bcdDevice= 1.21
[ +0.000005] usb 4-4.4.2: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[ +0.000001] usb 4-4.4.2: Product: USB5734
[ +0.000001] usb 4-4.4.2: Manufacturer: Microchip Tech
[ +0.000810] hub 4-4.4.2:1.0: USB hub found
[ +0.000025] hub 4-4.4.2:1.0: 3 ports detected
[ +0.175773] usb 3-4.3: new full-speed USB device number 13 using xhci_hcd
[ +0.090010] usb 3-4.3: New USB device found, idVendor=1b3f, idProduct=2008, bcdDevice= 1.00
[ +0.000004] usb 3-4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ +0.000001] usb 3-4.3: Product: USB Audio Device
[ +0.000001] usb 3-4.3: Manufacturer: GeneralPlus
[ +0.015086] input: GeneralPlus USB Audio Device as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.3/3-4.3:1.3/0003:1B3F:2008.0009/input/input35
[ +0.050978] hid-generic 0003:1B3F:2008.0009: input,hidraw1: USB HID v2.01 Device [GeneralPlus USB Audio Device] on usb-0000:00:14.0-4.3/input3
[ +0.074901] usb 3-4.4: new high-speed USB device number 14 using xhci_hcd
[ +0.085489] usb 3-4.4: New USB device found, idVendor=03f0, idProduct=2488, bcdDevice= 6.25
[ +0.000004] usb 3-4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ +0.000001] usb 3-4.4: Product: USB4206 Smart Hub
[ +0.000001] usb 3-4.4: Manufacturer: Microchip
[ +0.000895] hub 3-4.4:1.0: USB hub found
[ +0.000066] hub 3-4.4:1.0: 5 ports detected
[ +0.709480] usb 3-4.4.2: new high-speed USB device number 15 using xhci_hcd
[ +0.084533] usb 3-4.4.2: New USB device found, idVendor=03f0, idProduct=4488, bcdDevice= 1.21
[ +0.000007] usb 3-4.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ +0.000002] usb 3-4.4.2: Product: USB2734
[ +0.000001] usb 3-4.4.2: Manufacturer: Microchip Tech
[ +0.000994] hub 3-4.4.2:1.0: USB hub found
[ +0.000026] hub 3-4.4.2:1.0: 4 ports detected
[ +0.074427] usb 3-4.4.3: new full-speed USB device number 16 using xhci_hcd
[ +0.089141] usb 3-4.4.3: New USB device found, idVendor=03f0, idProduct=0488, bcdDevice=17.46
[ +0.000006] usb 3-4.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ +0.000002] usb 3-4.4.3: Product: HP Thunderbolt Dock G4
[ +0.000001] usb 3-4.4.3: Manufacturer: HP Inc.
[ +0.000001] usb 3-4.4.3: SerialNumber: 11AD1D0AD7B57D030C1D0B00
[ +0.014037] input: HP Inc. HP Thunderbolt Dock G4 System Control as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.4/3-4.4.3/3-4.4.3:1.2/0003:03F0:0488.000A/input/input37
[ +0.050946] hid-generic 0003:03F0:0488.000A: input,hiddev96,hidraw2: USB HID v1.11 Device [HP Inc. HP Thunderbolt Dock G4] on usb-0000:00:14.0-4.4.3/input2
[ +0.702877] usb 4-4.4.2.1: new SuperSpeed USB device number 9 using xhci_hcd
[ +0.011461] usb 4-4.4.2.1: New USB device found, idVendor=0bda, idProduct=8153, bcdDevice=32.01
[ +0.000004] usb 4-4.4.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[ +0.000002] usb 4-4.4.2.1: Product: USB 10/100/1000 LAN
[ +0.000001] usb 4-4.4.2.1: Manufacturer: Realtek
[ +0.000002] usb 4-4.4.2.1: SerialNumber: 102000001
[ +0.072476] usb 3-4.4.2.2: new full-speed USB device number 18 using xhci_hcd
[ +0.094700] usb 3-4.4.2.2: New USB device found, idVendor=046d, idProduct=c349, bcdDevice=66.00
[ +0.000023] usb 3-4.4.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ +0.000001] usb 3-4.4.2.2: Product: LogiG MKeyboard
[ +0.000001] usb 3-4.4.2.2: Manufacturer: Logitech
[ +0.013873] input: Logitech LogiG MKeyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.4/3-4.4.2/3-4.4.2.2/3-4.4.2.2:1.0/0003:046D:C349.000B/input/input38
[ +0.039708] r8152-cfgselector 4-4.4.2.1: reset SuperSpeed USB device number 9 using xhci_hcd
[ +0.055158] r8152 4-4.4.2.1:1.0 eth0: v1.12.13
[ +0.002787] hid-generic 0003:046D:C349.000B: input,hidraw3: USB HID v1.11 Keyboard [Logitech LogiG MKeyboard] on usb-0000:00:14.0-4.4.2.2/input0
[ +0.003503] input: Logitech LogiG MKeyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.4/3-4.4.2/3-4.4.2.2/3-4.4.2.2:1.1/0003:046D:C349.000C/input/input39
[ +0.050356] hid-generic 0003:046D:C349.000C: input,hidraw4: USB HID v1.11 Keyboard [Logitech LogiG MKeyboard] on usb-0000:00:14.0-4.4.2.2/input1
[ +0.002439] hid-generic 0003:046D:C349.000D: hiddev97,hidraw5: USB HID v1.11 Device [Logitech LogiG MKeyboard] on usb-0000:00:14.0-4.4.2.2/input2
[ +0.074435] usb 3-4.4.2.3: new full-speed USB device number 19 using xhci_hcd
[ +0.087668] usb 3-4.4.2.3: New USB device found, idVendor=046d, idProduct=c09d, bcdDevice=52.02
[ +0.000005] usb 3-4.4.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ +0.000001] usb 3-4.4.2.3: Product: G203 LIGHTSYNC Gaming Mouse
[ +0.000001] usb 3-4.4.2.3: Manufacturer: Logitech
[ +0.000000] usb 3-4.4.2.3: SerialNumber: 207936684858
[ +0.006795] input: Logitech G203 LIGHTSYNC Gaming Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.4/3-4.4.2/3-4.4.2.3/3-4.4.2.3:1.0/0003:046D:C09D.000E/input/input40
[ +0.000156] hid-generic 0003:046D:C09D.000E: input,hidraw6: USB HID v1.11 Mouse [Logitech G203 LIGHTSYNC Gaming Mouse] on usb-0000:00:14.0-4.4.2.3/input0
[ +0.000930] input: Logitech G203 LIGHTSYNC Gaming Mouse Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.4/3-4.4.2/3-4.4.2.3/3-4.4.2.3:1.1/0003:046D:C09D.000F/input/input41
[ +0.050699] hid-generic 0003:046D:C09D.000F: input,hiddev98,hidraw7: USB HID v1.11 Keyboard [Logitech G203 LIGHTSYNC Gaming Mouse] on usb-0000:00:14.0-4.4.2.3/input1
[ +3.631114] r8152 4-4.4.2.1:1.0 eth0: carrier on
Disconnecting the dock (including external monitors) and reconnecting it free'd a lot of memory usage, looks like a better workaround than rebooting, so thanks for that, I hope the logs help.
Offline
+1 on this, same scenario, external monitor
keval@laptop ~> uptime
15:52:57 up 6:03, 2 users, load average: 1.00, 1.40, 1.44
Unplugging and replugging the external display brings memory usage back to normal levels.
Dmesg prints nothing when unplugging and replugging the monitor.
Output of ps:
keval@laptop ~> ps -o pid,ppid,cmd -p (pgrep kwin_wayland)
PID PPID CMD
1165 1120 /usr/bin/kwin_wayland_wrapper --xwayland
1170 1165 /usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayland-f
Last edited by thechubbypanda (2024-12-17 16:08:07)
Offline
Are you using a different GPU for the external output? Try exporting https://invent.kde.org/plasma/kwin/-/wi … _gl_finish to the session by for example creating an executable script in ~/.config/plasma-workspace/env/kwin_env.sh
#!/usr/bin/sh
export KWIN_DRM_FORCE_MGPU_GL_FINISH=1
Last edited by V1del (2024-12-17 22:24:33)
Offline
+1 on this, same scenario, external monitor.
A little more info on my HW setup:
Laptop: ASUS TUF A15 FA506QR 16 RAM
CPU: AMD Ryzen 7 5800H
GPU1: AMD Radeon Vega Series / Radeon Vega Mobile
GPU2: NVIDIA GeForce RTX 3070 Mobile
External monitor: UltraGear 2k 180 HZ
I use a dock to connect directly to the NVIDIA GPU
I first started experiencing this when I first attached the external monitor (2 months ago), but at first the kwin_wayland process was killed by the system (Found that in dmesg, don't have screenshots).
Then instead of the system killing the process, everything was becoming more and more laggy up until a point where everything freezes. Unpluging the monitor wasn't helping my case now i am testing the solution with exporting KWIN_DRM_FORCE_MGPU_GL_FINISH=1
Offline
Are you using a different GPU for the external output? Try exporting https://invent.kde.org/plasma/kwin/-/wi … _gl_finish to the session by for example creating an executable script in ~/.config/plasma-workspace/env/kwin_env.sh
#!/usr/bin/sh export KWIN_DRM_FORCE_MGPU_GL_FINISH=1
I tried doing so but the problem persists. Unplugging the monitor is actually detrimental now, sometimes causes Plasma to crash, and it basically doesn't solve the issue, RAM will still grow.
Offline
How about Xorg/X11? Does that work better?
Offline
How about Xorg/X11? Does that work better?
Have been testing these days, Xorg/X11 is working fine, it is a problem when using wayland.
As to what is it causing it, I'm clueless, a friend of mine suggested it could be a compatibility issue with the dock, I am using an HP Thunderbolt Dock G4. Other users complaining about this problem where also using a dock AFAIK. Will test in the future with my external monitor connected directly to the laptop to rule out the dock as the main culprit.
I would like to use wayland as it is the only way to run waydroid
Offline
and swap is full.
If swap is full, then there is not enough swap, I'm probably wrong about that one though depending on the situation.
So this website has a guide on swap problems, it also applies to Linux, although ignore the unrelated "Custom Size, set both Initial and maximum" it is just for windows
Here it is
Make sure you have enough Virtual Memory
If you have 4 GB of RAM, set virtual memory to 8 GB (Custom size: set both initial and maximum size to 8192)If you have 8 GB of RAM, set virtual memory to 16 GB (Custom size: set both initial and maximum size to 16384).
If you have 16 GB of RAM, set virtual memory also to 16 GB (Custom size: set both initial and maximum size to 16384)
If you have 32 GB of RAM, set virtual memory also to 8 GB (Custom size: set both initial and maximum size to 8192) just in case.
Do not set “System managed size”, cause it’s slower. Fixed VM size is the most efficient setting.
If you have more RAM, then follow the 32GB one or if you have less than 4GBs (unlikely), then set the swap size to 16GBs
That is if you have enough disk storage and you don't plan on virtual machines and just games (that are small enough not to matter)
So here you go.
It's just related to your swap is full problem but if it fixed it, then let me know.
Offline
I am seeing the same issue on a Lenovo Thinkpad P1 Gen 4 using 2 external Lenovo P27h-10 monitors daisy-chained connected with USB-C and a ThinkPad Thunderbolt 4 Dock running KDE Wayland and NVIDIA drivers 565.77-1. When I directly connect the monitors to my Thinkpad (hence not through docking station) memory consumption of kwin_wayland keeps increasing over time. The memory consumption is still high after disconnecting the external monitors. Only after reconnecting them it drops. In may case it dropped from more than 20GB to 4.3 GB. I had my docking station connected (for Ethernet, and other stuff) during the test so it seems not related to the docking station.
Last edited by pletka (2025-02-07 11:04:36)
Offline
I've also been seeing this same issue. I've had some success with adding the following environment variables, ala V1del but bare in mind these are specific to Nvida GPUs:
#!/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export KWIN_DRM_DEVICES=/dev/dri/card1
I think this may actually be an issue with kwin itself though and it could well be worth the time to submit an issue over there.
Offline
Submitted back in November: https://bugs.kde.org/show_bug.cgi?id=496469
Offline
Pages: 1