Xorg and Wayland eating ram

Hello Garuda users.

I recently bought a Dell S3222DGM 32" to use for an external monitor for my 2022 Asus G14 and started noticing that Xorg was slowing filling up my 16GB of ram over the course of a day. Today I switched over to Wayland to see if there would be any difference but it does the same thing and is currently occupying over 50% of my ram. I've been searching for an answer for this issue but haven't really found anything specific to my hardware. Any help in resolving this issue would be greatly appreciated!

System:
Kernel: 6.2.11-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=0a76ce91-ca32-45d5-b211-8ec4105d11bd rw rootflags=subvol=@
quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
resume=UUID=9c55317a-9232-4743-a316-fee49efd0426 loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.27.4 tk: Qt v: 5.15.9 wm: kwin_wayland vt: 2
dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Laptop System: ASUSTeK product: ROG Zephyrus G14 GA402RJ_GA402RJ
v: 1.0 serial: <superuser required>
Mobo: ASUSTeK model: GA402RJ v: 1.0 serial: <superuser required>
UEFI: American Megatrends LLC. v: GA402RJ.317 date: 12/05/2022
Battery:
ID-1: BAT0 charge: 45.1 Wh (62.5%) condition: 72.2/76.0 Wh (95.1%)
volts: 15.9 min: 15.9 model: ASUSTeK ASUS Battery type: Li-ion serial: N/A
status: not charging
Device-1: hidpp_battery_0 model: Logitech Wireless Mouse serial: <filter>
charge: 55% (should be ignored) rechargeable: yes status: discharging
CPU:
Info: model: AMD Ryzen 9 6900HS with Radeon Graphics bits: 64 type: MT MCP
arch: Zen 3+ gen: 4 level: v3 note: check built: 2022 process: TSMC n6 (7nm)
family: 0x19 (25) model-id: 0x44 (68) stepping: 1 microcode: 0xA404102
Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
L3: 16 MiB desc: 1x16 MiB
Speed (MHz): avg: 2930 high: 4641 min/max: 1600/4934 boost: enabled
scaling: driver: acpi-cpufreq governor: ondemand cores: 1: 4412 2: 3778
3: 2062 4: 2062 5: 2063 6: 1600 7: 2062 8: 2060 9: 4641 10: 4617 11: 4639
12: 4639 13: 2062 14: 2060 15: 2062 16: 2062 bogomips: 105400
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: AMD Navi 23 [Radeon RX 6650 XT / 6700S 6800S] vendor: ASUSTeK
driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm)
built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16 ports:
active: HDMI-A-1,eDP-1 empty: DP-1 bus-ID: 03:00.0 chip-ID: 1002:73ef
class-ID: 0300
Device-2: AMD Rembrandt [Radeon 680M] vendor: ASUSTeK driver: amdgpu
v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm) built: 2020-22
pcie: gen: 4 speed: 16 GT/s lanes: 16 ports: active: none empty: DP-2,
DP-3, DP-4, DP-5, DP-6, DP-7, DP-8, DP-9, eDP-2 bus-ID: 07:00.0
chip-ID: 1002:1681 class-ID: 0300 temp: 58.0 C
Device-3: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo
bus-ID: 3-3:4 chip-ID: 13d3:56eb class-ID: fe01 serial: <filter>
Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.1
compositor: kwin_wayland driver: X: loaded: amdgpu
unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
gpu: amdgpu,amdgpu d-rect: 4480x1440 display-ID: 0
Monitor-1: HDMI-A-1 pos: primary,left res: 2560x1440 size: N/A modes: N/A
Monitor-2: eDP-1 pos: right res: 1920x1200 size: N/A modes: N/A
API: OpenGL v: 4.6 Mesa 23.0.2 renderer: AMD Radeon RX 6700S (navi23 LLVM
15.0.7 DRM 3.49 6.2.11-zen1-1-zen) direct-render: Yes
Audio:
Device-1: AMD Navi 21/23 HDMI/DP Audio vendor: ASUSTeK driver: snd_hda_intel
v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 03:00.1
chip-ID: 1002:ab28 class-ID: 0403
Device-2: AMD Rembrandt Radeon High Definition Audio driver: snd_hda_intel
v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 07:00.1
chip-ID: 1002:1640 class-ID: 0403
Device-3: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: ASUSTeK
driver: snd_pci_acp6x v: kernel alternate: snd_pci_acp3x, snd_rn_pci_acp3x,
snd_pci_acp5x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
snd_sof_amd_renoir, snd_sof_amd_rembrandt pcie: gen: 4 speed: 16 GT/s
lanes: 16 bus-ID: 07:00.5 chip-ID: 1022:15e2 class-ID: 0480
Device-4: AMD Family 17h/19h HD Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: 07:00.6 chip-ID: 1022:15e3 class-ID: 0403
API: ALSA v: k6.2.11-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: PipeWire v: 0.3.69 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
vendor: Foxconn driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s
lanes: 1 bus-ID: 05:00.0 chip-ID: 14c3:0616 class-ID: 0280
IF: wlp5s0 state: up mac: <filter>
Bluetooth:
Device-1: Foxconn / Hon Hai Wireless_Device type: USB driver: btusb v: 0.8
bus-ID: 5-1:2 chip-ID: 0489:e0e2 class-ID: e001 serial: <filter>
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Drives:
Local Storage: total: 953.87 GiB used: 169.78 GiB (17.8%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron model: 2450 MTFDKBA1T0TFK
size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
lanes: 4 type: SSD serial: <filter> rev: V5MA010 temp: 42.9 C scheme: GPT
Partition:
ID-1: / raw-size: 937.23 GiB size: 937.23 GiB (100.00%)
used: 169.77 GiB (18.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 937.23 GiB size: 937.23 GiB (100.00%)
used: 169.77 GiB (18.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 937.23 GiB size: 937.23 GiB (100.00%)
used: 169.77 GiB (18.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 937.23 GiB size: 937.23 GiB (100.00%)
used: 169.77 GiB (18.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 14.86 GiB used: 153.8 MiB (1.0%)
priority: 100 dev: /dev/zram0
ID-2: swap-2 type: partition size: 16.34 GiB used: 0 KiB (0.0%)
priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
Sensors:
System Temperatures: cpu: 68.9 C mobo: N/A
Fan Speeds (RPM): cpu: 3500
GPU: device: amdgpu temp: 61.0 C mem: 64.0 C fan: 0 watts: 18.00
device: amdgpu temp: 61.0 C
Info:
Processes: 395 Uptime: 6h 46m wakeups: 11 Memory: 14.86 GiB
used: 10.96 GiB (73.8%) Init: systemd v: 253 default: graphical
tool: systemctl Compilers: gcc: 12.2.1 Packages: pm: pacman pkgs: 1925
libs: 555 tools: octopi,paru Shell: fish v: 3.6.1 default: Bash v: 5.1.16
running-in: konsole inxi: 3.3.26
Garuda (2.6.16-1):
System install date:     2023-04-01
Last full system update: 2023-04-22
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut
Windows dual boot:       Probably (Run as root to verify)
Failed units:            fancontrol.service

It's a feature not a bug :smiley:

Unused RAM is wasted RAM

Check with htop, sort by mem, which Apps eat your RAM.
Check if psd is used.

cat /home/$USER/.config/psd/psd.conf

I ran htop and see that there are 13 instances of the following:

/usr/lib/Xorg -nolisten tcp -background none -seat seat0 vt1 -auth /var/run/sddm/{9ef812e3-abc2-4933-86ce-053b26368ac9} -noreset -displayfd 17

I also ran the code you provided to open psd.conf but am unsure as to what I'm looking for.

BROWSERS=(firedragon firefox chromium opera vivaldi google-chrome)

Browser take up a lot of disk space and unnecessarily burden the hard disk. It’s better to use the RAM.
Your GPU('s) are using RAM too.

So the high ram usage is normal then? If Xorg and/or Wayland are using 90% of my ram and I need to open a program will the ram space be allocated properly without causing a crash? Thanks for your replies so far

Linux uses RAM differently than you may be used to. This may be helpful for getting familiar with the general idea:

https://www.linuxatemyram.com/

2 Likes

Thanks for the link! I've been using Linux off and on for a couple of years but have only just now noticed the ram usage thing since I have conky running. The article you provided helped, thanks again!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.