HighMemory

Debugging Memory Issues

X maintains a pool of memory for GUI applications. As a consequence, it will often appear that X is using a lot of memory, when in fact it is one or more applications that are consuming the memory. top may not indicate which application is to blame, but use of xrestop or other X memory display tools may help indicate it.

As a workaround, you can limit the amount of RAM X is allowed to allocate via ulimit -m in your X startup script.

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, making the patch which caused the memory leak to appear unnecessary. The GLX 1.4 enablement originated with Fedora and was incorporated into Debian, it was 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

Simon Elmir

Gnome

Radeon Mobility X700

radeon

Yes

No

24 hours of use, 182317056 object bytes with lots of programs open, 89669632 after closing most of them. Graphics performance is still good.

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

Pahan Seneviratne

GNOME

Intel 82865G

intel

Yes

No

Seems the memory leak problem is fixed so far

Sebastien Bacher

GNOME

intel 965

intel

Yes

No

C de-Avillez

GNOME

amd64

ati

Yes

No

PedroVillavicencio

GNOME

82G33

intel

Yes

No

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

Sure think so

No

This may have also fixed http://launchpad.net/bugs/564181

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

With 2ubuntu7~xup2 it fixed the problem, but with 2ubuntu7 I see again very high memory usage. Restarting Xserver does NOT help. Now with ~xup2 again: 10254 objects; 281116672 object bytes

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

Yes

none so far

A big difference between the object bytes count, was well over 1Gb, now hovers round 130-160Mb.

Brett Howard

GNOME

Radeon X300M

ati

Yes(so far)

Slow down was very apparent on this system before reverting. Staying below 90MB after. Was >1GB 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?

Yes

None so far

Liam Dennehy

GNOME

Intel 945GM/GMS, 943/940GML Express

i915 driver

Testing

No

with 1.4 after 2.5 days uptime, object bytes around 900-980MB, with 1.2 and 1 hour uptime 120-170MB. Problem was never apparent on 1.4

LoicMinier

GNOME

GM45 (Lenovo X301)

intel

Yes

High CPU in Xorg process; not sure what triggered it; only happened once

Rafi Rubin

GNOME

Intel 3400 Series (Dell Studio 17)

ati

Yes

No

Mathieu Tournier

KDE

Radeon Mobility HD 3670 (Dell Xps 1640)

ati

Yes

No

Seems good after one day uptime

Christian Dröge

Gnome

Radeon HD3300

ati

Yes

No

Jan Varho

GNOME

Radeon HD 4850

ati

Yes

No

2 hours' testing, will update if changes

Oliver Diedrich

GNOME

Radeon X1600 (RV530)

radeon

No problem initially

no

Luigi Messina

GNOME

Intel Q45/Q43

i915

No problem initially

No

Seems a bit faster after few hours

Oscar Fröberg

GNOME

Intel 945GM/GMS/GME

Intel

Yes

No

F. Bornschein

KDE

ATI Radeon X1400 Mobile

ati

"Yes"

OGL Apps (games(QuantZ, WoG) are laggisch and let sound crack/stuck(composited kwin too)

(173154304 object bytes / 6h up) all not that bad like last week but also not that good/fast/perfect like beta1

Matt Zimmerman

GNOME (UNE)

945GM/GMS/GME, 943/940GML

intel

not confirmed affected

running OK so far (5 minutes)

Scott Howard

GNOME

R350

ati

yes

none yet

shutdown splash screen bug is fixed (it appears now), transient graphic corruption bug appears fixed

Sebastian Martinez

GNOME

Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)

intel

yes

none yet

low memory usage at this time

Martijn van de Streek

Gnome

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

intel

Yes

No

Joel Stanley

GNOME

Intel 965GM

Intel

Yes

No

Dimitry Andric

GNOME

Intel 82Q35

Intel

Yes

No

Tobias Stegmann

KDE

GeForce 8400M GS

nvidia

Yes

No

sdafin

GNOME

Intel 945 GM (rev 03) (FS Lifebook S7110)

Intel i915

Yes

None so far

32-bit x86, With GLX version 1.4, after 30 min usage: 631MB object bytes, with v1.2 after 20 hours: 113MB object bytes, not tested gaming

K7AAY

GNOME

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

intel

Yes

No

up 13 hrs, /sys/kernel/debug/dri/0/gem_objects 96,940,032 object bytes, increased from 65,757,184 at start

Nate Eastman

GNOME

Intel 945GME (Hp Mini 110)

intel

Yes

No

Jason Whitlark

GNOME

Intel 965GM (Lenovo x61s)

intel

Yes

No

Omer Akram

GNOME

Intel 945GM

intel

Yes

No

marcinq

KDE

radeon x1200 rs690

ati

Yes

No

Denis Rut'kov

XFCE

GeForce4 Ti4200

nouveau

No problem originally

No

Tested with standard ubuntu nouveau driver without 3D acceleration

Mike Leuty

GNOME

Intel GMA X4500HD

i915

Yes

Not sure

Had an odd moment where text wouldn't enter properly into the "Subject" line while composing a GMail using Firefox, but it cleared and has not recurred.

Matt Bradley

GNOME

M56P [Radeon Mobility X1600]

radeon

Yes

Not sure

(this is on a iMac5,1 version 1.0) ran a loop for 6 hours using eog, memory usage didnt increase after the new packages were installed.

mue.de

KDE

Intel Mobile GM965/GL960 (rev 03)

Intel

we'll see

(testing)

increased from 143M to 613M object bytes in 1h

Gavin Chappell

GNOME

Intel GM45 (Toshiba Portege A600)

intel

Yes

No

Hovering around 100mb +/- 10mb after 6:30 uptime, before fix was 1GB after ~2 days. X seems much more responsive, will see how good it is after a few more suspend and resume cycles.

Ben Bacarisse

GNOME

Intel GMA X4500HD (Lenovo T400)

i915

Yes

No

Never noticed the slowdown before but I did see swap getting eaten up. That's not happening now and the GEM objct count is sane again (it was negative before).

itsjareds

GNOME

Intel 946GZ (Lenovo ThinkCentre M55e)

intel

Yes

No

Bug caused instability within hours on my 1GB physical/600MB virtual memory station. Update works so far.

Grant Likely

GNOME

Intel 945GM (MacBook 2,1)

intel

Yes

No

No problems in 24 hours

Mervin Beng

Xubuntu / Openbox+fbpanel

MSI Wind / Intel 945GM

intel

Yes

No

No problems so far

Mervin Beng

Xubuntu / Openbox+fbpanel

Dell Studio 15 / ATI RV620)

ati

Yes

No

No problems so far

Tomasz Czapiewski

KDE

Radeon 9600

ati

Yes

No

Jan Hülsbergen

GNOME

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

intel

Yes

No

Tim Wieneke

KDE

M56P [Radeon Mobility X1600]

radeon

Yes

No

on start: 116281344 after some minutes (30min) decreasing to 109240320

Claus Henriksen

GNOME

Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller rev 7

intel i915

Yes

No

Problem still gone after 18 hours uptime

Markus Mueller

GNOME

Radeon X1550 (RV505)

radeon

Yes

No

Erich N. Pekarek

GNOME

Radeon RV280 (9200)

radeon

Yes

No

620072960 object bytes with glx 1.4; after two hours with GLX 1.2 with only few desktop action: 105943040 object bytes; after 4 hours with almost no action: 148340736 object bytes; DRI2 is enabled by default on this card. Deactivation of KMS was necessary in order to get compiz running again. Still problems with docky menu bar (background issue).

Andreas Reichel

UNE

Intel 945GME (Eee 1005HA)

intel

Yes

No

Tarek Loubani

Gnome

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

intel

Yes

No (testng)

Working after 2 days of uptime with occasional suspend

Chris Johnson

Gnome

Neomagic NM2380

xserver-xorg-video-neomagic

Yes

No

Works the same as it does in Karmic. The bug in Ver. 1.4 ate my memory and swap within minutes on a DVD.

Kristian Valentin

KDE

GeForce 210

nouveau

No

not sure

945MB after 5h uptime

Mahan Hooshmand Rad

Gnome

Radeon Mobility X300

ati

No

No

540MB of gem objects after 2h uptime. Working with the OS seems like a slide show now

Thomas Otto

Gnome

ATI RV380 Radeon X600

ati

Yes

No

120MB after a day.

Bob X

Gnome

Intel 915

Intel

Yes

Yes

Paweł Miniewicz

Gnome

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

i915

Yes

No

Was: 450M object bytes after rebooting and starting thunderbird, opera, pidgin, skype; 1,2G object bytes after 1h making system unusable. Now: 150M object bytes after 4 days uptime.

Mario Rezende

KDE

ATI - Radeon HD 2400 XT

fglrx_pci

Yes

No

Worked 4 hours with 2 Monitors in Multi-Display mode, with Firefox (many open tabs), Eclipse IDE and 2 Desktops.

Jesse Sweetland

KDE SC 4.5

ATI - Radeon HD 4350

radeon

Yes

No

GEM object bytes 251437056 after 24 hours; No GPU reset issues since update. Running Kontact, NetBeans, Chrome, Konsole, SQuirreL, Kopete, and KRDC (single desktop, compositing enabled)

X/Troubleshooting/HighMemory (last edited 2012-04-14 02:29:48 by bryce)