[lug] X is a huge memory hog, why?

D. Stimits stimits at comcast.net
Sun Sep 14 12:45:56 MDT 2003

Bryan Field-Elliot wrote:

> Hi folks,
> I'm running RedHat 9 on a system with 1GB RAM. I'm trying to pare down
> memory utilization of running processes, and to my surprise I found X to
> be the biggest offender. With no other desktop apps running, X hovers
> around 95-100 MB of memory!
> A "ps" of the process shows this:
> root      3094  2.3  2.5 106672 25776 ?      S    02:46   0:57
> /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth vt7
> I'm not sure the difference between VSZ and RSS (is RSS the actual RAM
> used, vs. virtual RAM in the swap file?) Either way this seems terribly
> wrong, can someone confirm that this either looks correct or looks way
> out of line?

I'm not positive of how this breaks down, Peter was right though when he 
said it includes the size of every child. Use ps with -f to see a tree, 
and subtract out child processes (though I'm not sure which parts are 
shared or not).

The thing that might be the real killer...and I am not positive how this 
works (I could be wrong)...is that if you have AGP enabled (of course it 
has to be an AGP slot), then your memory use will include say 32 MB of 
AGP memory...which is not actually part of the system. On top of this, 
if you actually run an OpenGL or other hardware accel app, the system 
can reserve an aperture of system memory for swapping into the AGP 
texture memory...possibly doubling the size of memory listed that is 
part of AGP, where that half of memory is actually used from the DIMM 
slots. In your X11 config, you may wish to turn off any AGP or hardware 
accel while testing.

D. Stimits, stimits AT comcast DOT net

More information about the LUG mailing list