HighMemory

Revision 64 as of 2010-04-22 08:05:55

Clear message

GEM memory leak from GLX 1.3/1.4 backport

Recently in Lucid, a major memory leak was found in the X.org server which causes the computer to get slower and slower over time. This is reported as bug 565981. This does not affect cards using proprietary drivers or not using DRI2 because it is specific to the glx module that the open drivers use. Intel will always be affected since DRI2 is used with and without KMS, ATI uses DRI1 without KMS.

One possible solution is to roll back the GLX 1.4 enablement patches, and the patch which caused the memory leak to appear. These GLX patches were produced by RedHat and incorporated into Debian, they were not brought in due to Ubuntu-specific requirements and thus it is believed dropping these patches would not impact any of Lucid's development goals. The one risk to be mindful of is if any userspace applications have come to depend on the newer GLX functionality.

To verify that you have this specific problem, open a terminal and run

  •    grep "object bytes" /sys/kernel/debug/dri/0/gem_objects

If it is a large number (for example: 1GB or higher was possible after 8 hours on intel, a negative value indicates multiple gigabytes of memory lost) then you can confirm that you are experiencing this. If it is not that large and shows no signs that will get that large after 24 hours of uptime then your issues are most likely unrelated to this specific problem.

Even if you are not affected by this, testing of these packages is appreciated and please add your information to the bottom if you do so.

Installing the test packages

Please do the following to upgrade to the proposed X server with the fix:

  •   sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
      sudo apt-get update
      sudo apt-get dist-upgrade

After that, reboot and log in.

Testing

Please work with your system normally for a few hours with compiz enabled (at which point the current lucid X.org server should feel really sluggish), as well as check functionaly and performance of:

  • Video playback (fullscreen and windowed)
  • Games (extremetuxracer, sauerbraten, etc.)
  • compiz (quickly change desktops and move windows around)
  • Flash movies
  • etc.

Please verify that glxinfo | grep "GLX version" says "1.2", not "1.4".

Reverting back to lucid packages

sudo apt-get install ppa-purge
sudo ppa-purge ppa:ubuntu-x-swat/x-updates

Feedback

Your name

Desktop

Chipset

Driver (fglrx vs. ati, etc.)

Bug fixed?

Any regressions?

Comments

Martin Pitt

GNOME

GMA945 (Dell Latitude D430)

intel

Yes

No

also fixes long shutdown hang

Martin Pitt

UNE

GMA945 (Dell Mini 10)

intel

Yes

No

Didier Roche

GNOME/UNE

GMA945 (on both netbooks)

intel

Yes

Not yet (after one workday)

Ken VanDine

GNOME

GM45

intel

Yes

No

Ken VanDine

UNE

945GME

intel

Yes

No

Sebastien Bacher

GNOME

intel 965

intel

(testing)

testing

C de-Avillez

GNOME

amd64

ati

(testing)

testing

PedroVillavicencio

GNOME

82G33

intel

(testing)

(testing)

Stefan Lesicnik

GNOME

GeForce GTX 260M

nvidia

(testing)

(testing

Apparently nvidia driver bypasses xserver glx, so not good testcase (works ok though)

Thanh Bui Van

GNOME

ATI Radeon

Intel x86

Yes

No

Robert Hooker

Gnome/UNE

945GME

intel/fbdev

Yes

No

Robert Hooker

Gnome/UNE

915GM

intel/fbdev

Yes

No

Robert Hooker

Gnome/UNE

G33

intel/fbdev

Yes

No

Robert Hooker

Gnome

HD3400M

ati

Yes

No

Robert Hooker

Gnome

SIS 760GX

sis

No problem originally

No

Updating to the xserver in x-updates on this machine fixes the problem where clutter based apps (such as gnome-games) fail to start when using Software Rasterizer (bug: 561734)

Robert Hooker

Gnome

8400M GS

nouveau

No problem originally

No

As above, clutter apps using swrast (which nouveau uses) are fixed with the xserver in the PPA

Jamie Strandboge

Gnome

Radeon 7500

ati/KMS/DRI2

Yes

No

Using the following from the bug shows that gem objects are increasing, but not X memory: pid=`pidof X` ; for t in `seq 1 10`; do eog /usr/share/backgrounds ; echo `grep "object bytes" /sys/kernel/debug/dri/0/gem_objects` `ps ocomm,vsz,rss $pid |grep X`; done

Murat Gunes

GNOME

GMA945

intel

Yes

No

GEM object count now seems to return to original value after a minute with the test case in the bug

Dave Lentz

GNOME/KDE

RV710/RadeonHD4550

ati

yes

(testing)

BrianMurray

Gnome

RV730 PRO/RadeonHD4650

ati

(testing)

Erik Andersen

Gnome

Nvidia Geforce 7300s

nvidia

(testing)

We'll see

Erik, the nvidia/fglrx drivers are not affected. Please read the description above and then delete this entry.

Colin Williams

Gnome

Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)

intel

Yes

unsure

fixed bug!

RickSpencer

Gnome

Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03)

-intel

Yes

No

Gem object count hovers between 1300 and 1450, grows and shrinks, memory usage hovers around 204398592 object bytes, low of about 161542144 high about 260308992. Played sauerbrate, quadrapassel, and a flash moving full screen

Romain Boissat

GNOME

GMA965

intel

Yes

No

I was only affected by increasing number of GEM object, memory use seemed quite normal, even after 3 days uptime. PPA packages fixed at least the GEM objects increase

Gary Trakhman

GNOME

x4500

intel

Yes

No

Seems good

Ed Fardos

KDE

nforce460

nvidia

we'll see

No

Xorg has blown up for the past four weeks iff GL compositing enabled, xrender is okay: http://sierraglider.com/craiger/P1010006.JPG . I realize we think the bug isn't in the nvidia driver, but that's a screenshot of a blown up xorg and exhausted swap.

Anthony Hook

GNOME

NVIDIA 8600M GT

nouveau

No

I don't know

I was able to have both the objects and object bytes raise until I ran out of memory and x thrashed to it's death.

Anthony Hook

GNOME

945GME

intel

Yes

No

It appeared to work alright

Virgil Brummond

GNOME

Intel Series 4 Mobile

Intel 2.11

Yes

No

Compiz works as usual. Playing 1080p HD video using gstreamer and 3d games as well. X stays at around 44mb.

Conn O'Griofa

GNOME

Radeon IGP 345M

radeon

No

No (but no improvement)

The problem is not fixed for my R100-based card. After one hour of uptime (watching a Flash video), system has become sluggish and GEM object bytes count swells.

Erick Brunzell

GNOME

82945G/GZ

Intel

Yes

No

Götz Christ

KDE

Intel 82865G rev 02

intel

Yes

No

Chris Halse Rogers

GNOME/UNE

GM45

intel

Yes

No

Chris Halse Rogers

GNOME/UNE

GeForce 9300M GS

nouveau

No problem initially

No

Lex McPhail

Gnome

Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller

Intel i915

(testing)

(testing)

Brett Howard

GNOME

Radeon X300M

ati

(Testing In progress)

Slow down was very apparent on this system before reverting

Haggai Eran

GNOME/UNE

945GME

intel

Yes

No

Zygmunt Krynicki

GNOME

Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)

intel?

(testing)

(testing)

Jan Varho

GNOME

Radeon HD 4850

ati

Yes

No

2 hours' testing, will update if changes