Xorg Memory Leak Fix for Lucid 10.04 and Maverick 10.10 ATI Proprietary fglrx

As much as this should be fixed by now, it is not. A real and true memory leak fix does not exist and probably won’t for quite some time. However, the bash script below will free memory in X every 60 seconds when using the proprietary fglrx driver. I am not sure if the memory leak is in fglrx or X. The leaks do not exist on the open source drivers, but, who knows.

If you have not installed the ATI fglrx driver yet, it is now really simple on Lucid and Maverick. So… for reference:

$ sudo apt-get install fglrx fglrx-amdcccle fglrx-modaliases
$ sudo aticonfig --initial
$ sudo reboot

Yep, that’s it, installed.

Now we need to create a simple bash script to free up memory from X on a consistent interval. In the root of your home directory, type:

$ touch xmemclear
$ chmod u+x xmemclear

Now use vim, vi, gedit, whatever floats your boat and c&p the following:

#!/bin/bash
sleep 30
while [ 1 ] do
    glxinfo | grep 'hide output'
    sleep 60
done
return 0

Now add this script to your startup applications:

System > Preferences > Startup Applications

Or if you want to stick to a shell ;)

$ cd .config/autostart/
$ vim xmemclear.desktop

And paste the following:

Remember to replace USER with your home directory name on the Exec= line!

[Desktop Entry]
Type=Application
Exec=/home/USER/xmemclear
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=xmemclear
Name=xmemclear
Comment[en_US]=
Comment=

Now if you don’t want to log out to enable the script just simply…

$ sh ~/xmemclear &disown
    • feilen
    • July 26th, 2011

    You have a bit of an error there,
    while [1] do
    needs to be
    while [1]; do
    Thanks for the fix!

  1. June 27th, 2011
    Trackback from : Maverick memery | Takemystuf
You must be logged in to post a comment.