neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.75k stars 1.73k forks source link

Memory leak in Xorg only when running with Xrdp #1228

Open geiseri opened 6 years ago

geiseri commented 6 years ago

I have a problem with xrdp when using the Xorg drive and Xvnc that over the course of a day the Xorg server starts to consume over 70% of my usable memory on a 8GB virtual machine. What is strange is that if I run the X session from the console I do not see such memory consumption. It grows pretty quickly with the Xorg driver. A KDE Session with chrome running will blow through it in about an hour. XVnc will give me about 4 or 5 hours.

I am on Arch linux and this was after a recent update, but since it is a rolling release there are tons of moving parts. Is there a way I can root cause this and get the bug to the right party? The only common thread is that the session is running inside from xrdp.

jsorg71 commented 6 years ago

So it's the Xorg process that grows? This might be an xrdp leak but if an X client keeps creating Pixmaps, it can do this too.

geiseri commented 6 years ago

Yes, it is the Xorg process. I did try xrestop and there was nothing obviously growing. I find it strange it impacts xrdp sessions and not console sessions. I will try a straight up Xvnc session tomorrow and see what that does.

kgroombr commented 6 years ago

I have been having the same issue for about a month now. I use Gentoo, so my distribution is a moving target, so I am not exactly sure what changes caused this issue. A couple months back, I didn't have any problem. Running VMware Workstation on the remote system causes Xorg memory usage to go through the roof very quickly (16GB of memory is gone in 15 minutes) and restarting X is the only way I have found to recoup the memory. I have no issues when running VMware Workstation logged on locally to the same system. More than happy to do what it takes to track down the issue.

moobyfr commented 6 years ago

What is the Xorg version ?

kgroombr commented 6 years ago

Currently 1.20.2, but was also an issue with 1.20.1, before that, I am not sure. I actually have two Gentoo systems I access via xrdp and both have the same issue. Just a guess, but it may be related from upgrading from 1.19.X to 1.20.X.

kgroombr commented 6 years ago

I downgraded to xorg server 1.19.5 and the memory leak was still present.

zhanglei002 commented 5 years ago

Try downgrading your Mesa version.

rbi commented 5 years ago

I have a similar issue. I use XRDP with Hyper-V on Windows 10/18.09. I tried with and without Hyper-V sockets. KSysguard shows that "shared memory" is leaked. It leaks about 1GB/Minute until all available RAM is gone.

I'm running the Ubuntu 19.04 development release. When I boot that system directly (without Windows/Hyper-V) I don't have memory leak issues. I have the propriatary NVidia drivers installed. Maybe they are related to the problem?

At work I use Ubuntu 19.04 over Hyper-V on Windows 10/17.03 without memory leak issues. There I don't have the NVidia drivers installed.

lunabunja commented 1 year ago

I can reproduce this issue on Artix on a Hyper-V VM Reproduced without Xrdp