Skip

X11 leaking?
June 3, 2008 3:24 PM   Subscribe

Does my X11 server have a memory leak?

My office workstation is a Dell Precision 390, which has a dual-core Core 2 Duo in it, with 4 GB of RAM. The workstation is running Red Hat Enterprise Linux 4:

$ uname -a
Linux ... 2.6.9-67.0.7.ELsmp #1 SMP Wed Feb 27 04:47:23 EST 2008 x86_64 x86_64 x86_64 GNU/Linux


Here's the version of X11 this workstation is running:

$ xterm -v
X.Org 6.8.2(192)
$ rpm -qa xorg-x11
xorg-x11-6.8.2-1.EL.33.0.2


Running system monitor, one monitor (GNU System Monitor 2.8) claims I have 100% of the memory in use, of which 37% is cached. Another monitor (System Monitor 2.7) suggests 2.2 GiB of 3.6 GiB is in use.

If I run top, the process X (or, /usr/X11R6/bin/X) takes up the most memory and CPU, and reports a different value from the other two monitors:

PID USER PR NI %CPU TIME+ %MEM VIRT RES SHR S COMMAND
5508 root 15 0 6 29:24.93 45.4 2503m 1.6g 9600 S X


Is it normal for the X11 server to use this much memory? What can I do to improve this?

I'm running GNOME 2.8 as the desktop manager.

My workstation has frequent "pauses" where, for example, I try to do work and the computer freezes for a moment or two, then keeps working. The IT guy already replaced RHEL 5 with RHEL 4 and that helped a lot, but my computer is still slow. Using KDE instead of GNOME hasn't helped much.

I can't really do much to change workstation settings as it is locked down. If there's a memory leak or other technical problem, I'd like to go to my IT guy with as much info as possible to save his time (and mine). I'm running some intensive work and need as much CPU and memory as I can get.

Thanks for any advice.
posted by Blazecock Pileon to Computers & Internet (7 answers total) 1 user marked this as a favorite
 
I'm unsure why you think the symptoms you're reporting indicate a memory leak in the X server. X is pretty widely used, so if it was leaky you wouldn't be the only person to notice. As for memory usage, X may be memory-mapping files and video buffers in causing its virtual memory footprint to be much larger than its actual memory usage.

There could be other causes to the problem - a slow disk? Mapped network folders which contain important system files that are slow to access? I assume you have several NFS shares mounted - any of them have stuff you're using heavily that you can move locally?
posted by GuyZero at 3:30 PM on June 3, 2008


I'm unsure why you think the symptoms you're reporting indicate a memory leak in the X server.

From the tools I am using to report usage, it appears to be using between 50-100% of 4 GB of system memory. Granted, those values are not consistent between monitors, but they do seem consistent within the monitor used.

X is pretty widely used, so if it was leaky you wouldn't be the only person to notice.

Perhaps it might be interaction of that version of X with this version of whatever, that "whatever" being some other system component, video card, kernel, etc. which may not necessarily be reproduced by (many) other setups.

I assume you have several NFS shares mounted - any of them have stuff you're using heavily that you can move locally?

I run Firefox, Thunderbird and Terminal. Occasionally I run ggv to view PDFs. All of these apps are running locally. Terminal may access an NFS share when I run "ls -al", etc. in NFS'ed directories, but Firefox and Thunderbird should be doing the bulk of their work on the local drive.
posted by Blazecock Pileon at 3:43 PM on June 3, 2008


It's unusual for X to use that much memory. It may well be a memory leak.

You might try switching to different video drivers (i.e. vesa) and window managers to isolate the problem. Or just restarting X periodically if you can live with it... how long has it been running?
posted by qxntpqbbbqxl at 3:50 PM on June 3, 2008


The most useful thing you can do is to take regular snapshots of how much memory your X server is running. Maybe also with vmstat reports to show swapping activity.

There's no way an X server should take 1.5 gigs fo RAM. Either it's leaking memory itself or, more likely, some application is creating resources on the X server and they're not getting properly freed. Does the memory consumption go down if you log out and exit all of your applications? What about if you restart the whole X server via Ctrl-\ or similar means?
posted by Nelson at 4:34 PM on June 3, 2008


Does X still use all those CPU cycles if you aren't running any applications? Try shutting down as much as you can in Gnome and see if shutting down any one application makes a difference for X's usage.

In /etc/X11/xorg.conf, there should be a section labeled "Device" that tells X what driver to load. Does the configured driver match your hardware?
posted by Loudmax at 4:54 PM on June 3, 2008


I'm not convinced that your memory usage measurements really disagree with each other, but that's kind of irrelevant since X shouldn't be using so much memory by any metric.

I agree with Nelson; I've definitely seen Firefox make X use lots of memory, for example.
posted by Zach! at 4:56 PM on June 3, 2008


I find X to be leaky too, but it generally takes about 3 months of uptime before it becomes a problem and an X-restart (log out then in again) solves it. It doesn't CPU-hog.

I find that Mozilla use is the biggest cause of X memory allocation blowing out and that restarting it can cause X to release a LOT of memory. I think moz is allocating loads and loads of pixmaps for displaying stuff, which causes X to bloat. If you're running some graphics-heavy application, that could be the cause even if X itself is not buggy.

X will use CPU if you have actively-changing graphics on-screen - like animations in a browser.
posted by polyglot at 6:30 PM on June 3, 2008


« Older Where can I find a stuffed Cha...   |  Should I keep fighting, or pul... Newer »
This thread is closed to new comments.


Post