X-Server eats Memory

Support knowledgebase (pohletz_x11_consuming_mem)
Applies to

SuSE Linux: Version 7.3,7.2
XFree86: Version 4.1.0
KDE: Version 2.2.x

Symptom:

The X-Windows server eats more and more memory during operation until finally the system runs out of memory and the kernel starts killing processes (and eventually finally the X11 server) in order to survive.

Cause:

There seems to be a bug in memory handling somehwere in the rendering layer of Xfree86-4.1.0 It is only triggered, if you use antialiased (smoothed) fonts and icons. This is normally enabled via the switch "Use Anti-Aliasing for fonts and icons" in the KDE ControlCenter - Look and Feel - Fonts dialog. The problem only occurs with some video drivers.

Detection:

To check whether you are affected, use multiple large background images for your virtual screens and watch X11 memory consumption, e.g. by using top (at the shell prompt) and typing (shift)M to sort processes according to memory footprint. You will see a line like

PID USER     PRI  NI  SIZE  RSS SHARE STAT LC %CPU %MEM   TIME COMMAND

3241root      9   0   87580 37M 1868   R   0   0.0  14.8  5:52    X   

The 87580 is the total memory consumption of your X-Window system including the mapped video memory of your graphics card. The 37M indicates the amount of memory that is actually present in physical RAM and used by the X11 server (part of which may be shared with other processes).

If you change the virtual desktops and wait until the new background image has been rendered, you will see the memory footprint of your X11 increase. If it increases slightly (hundreds of kB) and after some rounds of switching stops growing, everything is fine.

If its memory footprint increases by Megabytes and does not stop growing after a few rounds, you are affected by the problem.

Use 'q' to exit top.

Solution:

Switch off Anti-Aliasing in the KDE control center.

Alternative solution for advanced users:

Alternatively, you may want to upgrade your X11 server to XFree86-4.2.0, where this bug has been fixed. Note that this is not recommended and should only be done by advanced users.

You can find RPMs for SuSE Linux at

ftp://ftp.suse.com/pub/suse/i386/supplementary/X/XFree86/XFree86-4.2.0-SuSE/ (US)

or

ftp://ftp.gwdg.de/pub/linux/suse/ftp.suse.com/suse/i386/supplementary/X/XFree86/XFree86-4.2.0-SuSE/ (Europe)

Please note that those packages are mainly for testing and have not been as thouroughly tested as the packages on our distribution. So the update is at your own risk.

Installation instructions:(please note that, due to actuality, the Version Numbers may be different from the ones mentioned below)

  1. Download all RPMs, including the ones in the sax2 and DRI directories.
  2. Switch to runlevel 3: Log out from KDE/X11, switch to the text console (Ctrl-Alt-F1), login as root and enter init 3.
  3. Make sure you /usr partition is writable. If you have mounted it read-only, enter mount -o remount,rw /usr.
  4. Install the X11 upgrade by entering (take care to substitude the correct version numbers according to the actual downloaded version of the packets)
  5.     
            rpm -Uhv xf86-4.2.0-2.i386.rpm xshared-4.2.0-2.i386.rpm
            rpm -Uhv XFree86-compat-libs-4.2.0-2.i386.rpm
            rpm -Uhv xloader-4.2.0-2.i386.rpm 
            rpm -Uhv xmodules-4.2.0-2.i386.rpm
            rpm -Uhv xfntscl-4.2.0-2.i386.rpm
            rpm -Uhv xdevel-4.2.0-2.i386.rpm
            rpm -Uhv xf86_glx-4.2.0-2.i386.rpm
            rpm -Uhv xman-4.2.0-2.i386.rpm
            rpm -Uhv sax2-4.3-292.i386.rpm 
            rpm -Uhv saxident-1.1-48.i386.rpm
    	rpm -Uhv xf86tools-0.1-146.i386.rpm 
    

    and so on...

    (xf86tools includes XftConfig otherwise Antialiasing support will no longer work!)

    This assumes that the downloaded RPMs are in your current working directory. Otherwise go there with cd or use full path names. Check what other packages you have installed with rpm -q PACKAGENAME where you insert the filenames dowloaded without the -4.2.0-2.386.rpm instead of PACKAGENAME. You should also upgrade them with rpm -Uhv.

  6. After all packages have been installed, you may set back your /usr volume back to read-only, if it was so before. mount -o remount,ro /usr. Note that this may fail due to processes that are running and using the old libX11 shared library. Ignore this problem or restart your machine. (You may instead use lsof to find out and restart those processes and try again to remount ro.)
  7. Switch back to runlevel 5: init 5

It might be also helpful to read the README file in

ftp://ftp.suse.com/pub/suse/i386/supplementary/X/XFree86/XFree86-4.2.0-SuSE/README

for installation instructions.

Note: SuSE is currently looking into the problem to see whether it can be fixed in XFree86-4.1.0, so that a fixed Xfree86-4.1.0 can be offered or whether it can offer an official upgrade to XFree86-4.2.0 that can be installed via YaST2 Online Update.

Please regard that we don't offer any costfree Installation Support for the above Advanced User Upgrade Instructions.


Keywords: XFREE, X11, SERVER, CRASH, SLOW, SERVER, FONTS, X11, MEMORY LEAK, ANTI-ALIASING, KDE, VM, KILLING PROCESS, OUT OF MEMORY, OOM, CRASH

Categories: X Server

SDB-pohletz_x11_consuming_mem, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 31. Jan 2002
SuSE Linux AG - Last generated: 31. Jan 2002 by pohletz (sdb_gen 1.40.0)