Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X Memory Leak
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Sun Oct 16, 2011 1:22 pm    Post subject: X Memory Leak Reply with quote

It seems like X has a memory leak -- it was using around 600 megs of ram, but xrestop only showed about 50 megs of stuff being used. This is on a session that has been around for about a month. Note that I'm by no means an expert in X and its memory usage, so I may be misunderstanding what xrestop covers.

Unfortunately while investigating this, I triggered the oom killer, so I don't have exact numbers.

Relevant packages (feel free to ask for other info if I've missed something):
kde 4.6.5
nvidia-drivers 275.09.07
xorg-server 1.10.4

I run KDE with compositing enabled, and my video card is an old GeForce 8600 GT, if that matters.

My questions are:
  • Has anyone else seen this?
  • How can I investigate it further in a week or two when the memory usage starts to creep up again?
I'm a developer by trade, so I'm not afraid of the command line or debuggers or even new tools; I've just not worked with X before, so I'm not sure where to start.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10310
Location: Córdoba (Spain)

PostPosted: Sun Oct 16, 2011 1:56 pm    Post subject: Reply with quote

What did the OOM killer kill?

If it was X, then the issue is probably related to nvidia drivers (you can check that by using nouveau or vesa in place of nvidia-drivers, and seeing if the problem can be reproduced.

If it was some other program which was killed it should be relatively easy to isolate and find the guilty.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Sun Oct 16, 2011 7:01 pm    Post subject: Reply with quote

It killed plasma-desktop, which is another high-memory process, but it only showed up as about 20 megs in xrestop. I don't recall what its total memory usage was, but it was well below X.

X went down with it, so I can't tell you if killing it cleared up X's memory usage or not.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10310
Location: Córdoba (Spain)

PostPosted: Sun Oct 16, 2011 10:03 pm    Post subject: Reply with quote

If plasma in in the middle, then the culprit might be a buggy plasmoid applet. But being a kde thing, you can't really be sure. It could be your video driver, I'd try disabling the desktop effects completely first and seeing what happens.

If plasma is leaking ram, you should be able to see it clearly in the RES column in top or htop. The problem with that is that some plasmoids might spawn a separate process. Just look around and see if you can see something abnormal. Watch out specially for 3rd party plasmoids that you might have installed either using the configuration dialog or manually.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Mon Oct 17, 2011 5:41 am    Post subject: Reply with quote

@i92guboj What happens if it is nvidia leaking memory? Suppose I unload (rmmod) the driver. Will it free up the memory then?

I am asking because I had a similar dilemma recently. I shut everything down to init 1. And I had only very few processes running,- udevd, v86d, login and zsh and the total memory being consumed was 200M! Then I proceeded to unload all the modules that were loaded. And the total memory used decreased by 2M only! So, I can not explain what was eating up the memory. Of course, nothing came up on htop/top/atop. So, it must have been a kernel driver.

This was after my system was up for 7 days+ with the same login session (e17, hadn't logged out for 7 days continuously). Kernel version was 2.6.38 and nvidia-drivers was 275.09.07, e17 with compositing on.

I have now upgraded the nvidia-drivers from stable to latest testing (285.05.09). I will see what happens over the next week.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10310
Location: Córdoba (Spain)

PostPosted: Mon Oct 17, 2011 6:44 am    Post subject: Reply with quote

ppurka wrote:
@i92guboj What happens if it is nvidia leaking memory? Suppose I unload (rmmod) the driver. Will it free up the memory then?


There's no way to know what a buggy driver can do when you rmmod it. It can do anything from locking your machine to displaying penguins in true color. Whether the leaked memory will be freed depends on where it is exactly leaking that memory. In any case, isn't the memory freed simply by restarting X?

Quote:

I am asking because I had a similar dilemma recently. I shut everything down to init 1. And I had only very few processes running,- udevd, v86d, login and zsh and the total memory being consumed was 200M! Then I proceeded to unload all the modules that were loaded. And the total memory used decreased by 2M only! So, I can not explain what was eating up the memory. Of course, nothing came up on htop/top/atop. So, it must have been a kernel driver.


How exactly are you measuring this? Can you post the output of 'free' when you are under that circumstances? You have to substract the memory used for cache and buffers from the used memory to get a more realistic number, in case you don't know.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
Wolfbone
n00b
n00b


Joined: 29 Sep 2004
Posts: 30

PostPosted: Mon Oct 17, 2011 10:05 am    Post subject: Reply with quote

I've had a slow X memory leak too for a while (i.e. since before xorg-server 1.10.4) and this is with ati-drivers. Over the years I've found crap like this happens from time to time with X and/or the proprietary drivers and IME it's futile to do anything but hope it'll go away with updates. On top of the memory leak, recent 3.0.x kernels have been less than stable with fglrx and X. *sigh*
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Mon Oct 17, 2011 11:58 am    Post subject: Reply with quote

i92guboj wrote:
ppurka wrote:
@i92guboj What happens if it is nvidia leaking memory? Suppose I unload (rmmod) the driver. Will it free up the memory then?


There's no way to know what a buggy driver can do when you rmmod it. It can do anything from locking your machine to displaying penguins in true color. Whether the leaked memory will be freed depends on where it is exactly leaking that memory. In any case, isn't the memory freed simply by restarting X?
No. It isn't. Like I mentioned, I dropped to the barest of the bare console via init 1. All init scripts are shut down except some udev related init script. rc-status shows only some "needed" runlevel. In fact, even all filesystems are mounted read-only.
Quote:
Quote:

I am asking because I had a similar dilemma recently. I shut everything down to init 1. And I had only very few processes running,- udevd, v86d, login and zsh and the total memory being consumed was 200M! Then I proceeded to unload all the modules that were loaded. And the total memory used decreased by 2M only! So, I can not explain what was eating up the memory. Of course, nothing came up on htop/top/atop. So, it must have been a kernel driver.


How exactly are you measuring this? Can you post the output of 'free' when you are under that circumstances? You have to substract the memory used for cache and buffers from the used memory to get a more realistic number, in case you don't know.
Yes. I am looking at the output of free -m, at the second entry of +/- buffers row. Equivalently, simply looking at the output of htop which lists only the actual memory being used (after subtracting buffers and caches).

EDIT: Here's a screenshot: http://ompldr.org/vYXVraw
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/


Last edited by ppurka on Mon Oct 17, 2011 2:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
Thistled
Guru
Guru


Joined: 06 Jan 2011
Posts: 551
Location: Scotland

PostPosted: Mon Oct 17, 2011 12:48 pm    Post subject: Reply with quote

Dunno if this helps, but I have noticed the nvidia-drivers consumes about 300MB of Ram, but when I set opengl to xorg-x11 I use about 300 less, which is kind of handy when one only has 2GB and needs most of that to crunch BOINC projects.
But yip, nvidia consumes much much more RAM than I would like. (Nvidia drivers always do in my opinion) My graphics card
has 256RAM (GeForce 8800GT) and yet nvidia seems to want to use my system ram instead. But hey, I probably don't understand how graphics cards work. :?
_________________
Whatever you do, do it properly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum