X11 eats up my memory

Hello. I know the title sounds a little newbie, but I'm having some issues with X11 on my computer. I'm running arch linux with i3 on X11 with all latest versions. After a couple of days my xorg running instance start claiming more and more memory and will not let go until I exit i3 and return to lightDM. I have tried investigating by disabling some software like compton and dunst without luck. I have also tried investigating with xrestop without anything that stands out of my mind.

uptime:

wall ~ ᐅ uptime
 13:11:41 up 1 day,  3:15,  1 user,  load average: 0,59, 1,04, 1,33

ps aux:

wall ~ ᐅ ps aux | egrep "i3|xorg|PID"
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       474 12.3 10.2 4140772 3365212 tty7  Rsl+ april04 202:58 /usr/lib/xorg-server/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
wall      589  0.0  0.1 148836 39396 ?        Ss   april04   0:24 i3-with-shmlog

Free:

wall ~ ᐅ free -h
              total        used        free      shared  buff/cache   available
Mem:            31G         13G         12G        1,0G        6,1G         19G
Swap:           15G          0B         15G

I would like some help on how to investigate further, get tips and hopefully solve my issue.

EDIT, an update of the RAM usage:

wall ~ ᐅ free -h
              total        used        free      shared  buff/cache   available
Mem:            31G         17G        7,2G        1,2G        6,9G         13G
Swap:           15G          0B         15G

wall ~ ᐅ ps aux | egrep "i3|xorg|PID"
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       474 14.2 24.2 8700896 7959036 tty7  Ssl+ april04 396:43 /usr/lib/xorg-server/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
wall      589  0.0  0.1 148836 39396 ?        Ss   april04   0:32 i3-with-shmlog

Posted Apr 5, 2018, 11:19 AM UTC · edited

010
doranduck•

I just stole your $PS1 : ^ )

2
ThatWallOP•

I use oh-my-zsh with a customised theme based on muse.

3
ThePiGrepper•

Hi, Just wondering here, but why do you have a 15G Swap on your machine? you apparently have a LOT of ram available, even with your current issue, and you use i3 as WM. do you really end up using that swap? curious here.

1
ThatWallOP•

Originally this computer had 16GB RAM so the swap space I created was about the same as the RAM, but I have upgraded it to 32GB at a later time.

1
ropid•

Can you try hitting the reload hotkey that you've configured in your i3 config? Does memory use go down at that point?

I think I remember a forum post from someone where the reason for his memory usage was using a font that provided pretty icons for the text in the status bar. That said, I think that person's memory usage went to the process that was painting the bar, not to Xorg.

Maybe something similar to this is still what's happening for you. Perhaps programs can ask the X server to keep graphics around, and some program just adds graphics without ever telling X that's it's okay to throw something old away. I would then try to experiment by going through all processes that are always running for you and try reverting to their default config or try an alternative program, so change things about i3, i3bar, and switch to a different web browser for a day.

About if i3 and i3bar could cause this, I think I do not have problems like you, but I usually shut down at the end of the day so might not have noticed a problem.

1
ThatWallOP•

Update: After disabling all xscreensaver screensaver (using just blank black colour) and starting it via xscreensaver -nosplash & there has been no more memory leaks.

1
lnx-reddit•

X11 is being discontinued. Use sway instead. Also, Archlinux takes like 7 seconds to start. So turning off the pc could be a solution.

-1
PandaMoniumHUN•

Not sure if serious, but Wayland is still far from replacing X. Also, rebooting should never be a solution as there are very valid reasons for running certain computers 24/7.

1
lnx-reddit•

Not sure if serious, but Wayland is still far from replacing X

Maybe for you, for majority it is good enough. And anyway Xorg is being discontinued.

0
canopeerus•

Xorg is being discontinued

Says who?

1