Memory leak in compiz (and maybe Xorg)

Bug #870042 reported by nerdy_kid on 2011-10-07
This bug affects 16 people
Affects Status Importance Assigned to Milestone
X.Org X server
unity (Ubuntu)

Bug Description

Compiz and Xorg both use large amounts of RAM, right now on my system compiz is using 206 megabytes (and growing) and Xorg is using 176 megabytes.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: unity 4.22.0-0ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-12.19-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 280.13 Wed Jul 27 16:53:56 PDT 2011
 GCC version: gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

ApportVersion: 1.23-0ubuntu2
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,grid,imgpng,gnomecompat,wall,ezoom,workarounds,resize,fade,unitymtgrabhandles,scale,session,unityshell]
CompositorRunning: compiz
Date: Fri Oct 7 09:39:06 2011
DistUpgraded: Log time: 2011-10-04 18:54:48.035566
DistroCodename: oneiric
DistroVariant: ubuntu
 nvidia-current, 280.13, 3.0.0-12-generic, x86_64: installed
 vboxhost, 4.1.2, 3.0.0-12-generic, x86_64: installed
 nVidia Corporation Device [10de:1251] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: CLEVO/KAPOK Computer Device [1558:5102]
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110921.2)
 xorg:nvidia_current - NVIDIA accelerated graphics driver (Proprietary, Enabled, In use)
 xorg:nvidia_current_updates - NVIDIA accelerated graphics driver (post-release updates) (Proprietary, Disabled, Not in use)
MachineType: System76, Inc. Gazelle Professional
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-12-generic root=UUID=ec478c56-ee35-4e4e-9915-ddd75d17f872 ro quiet splash pcie_aspm=off vt.handoff=7
SourcePackage: unity
UpgradeStatus: Upgraded to oneiric on 2011-10-04 (2 days ago) 08/09/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 4.6.4
dmi.board.asset.tag: Not Applicable Gazelle Professional
dmi.board.vendor: System76, Inc.
dmi.board.version: gazp6
dmi.chassis.asset.tag: Not Applicable
dmi.chassis.type: 10
dmi.chassis.vendor: System76, Inc.
dmi.chassis.version: gazp6
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr4.6.4:bd08/09/2011:svnSystem76,Inc.:pnGazelleProfessional:pvrgazp6:rvnSystem76,Inc.:rnGazelleProfessional:rvrgazp6:cvnSystem76,Inc.:ct10:cvrgazp6: Gazelle Professional
dmi.product.version: gazp6
dmi.sys.vendor: System76, Inc.
version.compiz: compiz 1:0.9.6+bzr20110929-0ubuntu3
version.ia32-libs: ia32-libs 20090808ubuntu25
version.libdrm2: libdrm2 2.4.26-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 7.11-0ubuntu3
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.11-0ubuntu3
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg: xserver-xorg 1:7.6+7ubuntu7
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.6.0-1ubuntu13
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20110811.g93fc084-0ubuntu1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.15.901-1ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110411+8378443-1

nerdy_kid (nerdy-kid) wrote :
nerdy_kid (nerdy-kid) wrote :

The ram usage also increases after resume from standby. I suspended with compiz using 178MB and
xorg using 95MB. I resumed (I reported this bug, perhaps they are related? and Compiz was using 189MB, with Xorg using 138MB.

nerdy_kid (nerdy-kid) wrote :

I suspended and resumed again, and now compiz is using 216MB and Xorg is using 200MB

summary: - Compiz and Xorg both use large amounts of RAM (150Mb+)
+ Memory leak in compiz (and maybe Xorg)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed
Arthur Peters (amp) wrote :

I am experiencing this problem and Compiz used over 500MB after being on overnight (around 18 hours total).

Didier Roche (didrocks) on 2011-10-25
Changed in unity:
status: New → Confirmed
Ingo Gerth (igerth) wrote :

Same problem on Elitebook 8560w, with nvidia-current. Compiz uses more than 300 MB.

Stephen A. Goss (postfuturist) wrote :

My computer was left on for 6 days (over Thanksgiving weekend) and compiz is using 2.5 GB of memory.

Stephen A. Goss (postfuturist) wrote :

Is this really an important issue? All you have to do is run "compiz --replace" every morning on your desktop, resize and move all your windows back to where they were, and presto, you get a bunch of memory back from the system. Except that over the weekend your whole desktop can freeze or become otherwise unusable due to compiz's lust for memory, in which case you just have to restart your computer without the option to save anything you were working on. I vote to close this issue as WONT FIX.

Arthur Peters (amp) wrote :

Memory leaks are bugs. Maybe not always high priority but this should stay open until it is fixed even if that takes a while and it isn't the focus of anyone working on it. Also closing this WONT FIX will leave anyone who has this problem in a way where it does matter (such as on a low-memory system) feeling that the community doesn't care about making good software and that is definitely not a good thing.

Also I hope you are joking about just killing compiz and then rearranging all your windows. It will work of course but it's a bandaid not a fix. It's doing manually something that should be automatic, which is always bad.

nerdy_kid (nerdy-kid) wrote :

I noticed that Xorg chews memory even with Unity-2D -- it's using 177MB of RAM and climbing right now. Perhaps that is a separate bug...

doug (r-d-vaughan) wrote :

This bug simply needs to be taken seriously. From what I have read this issue mostly effects users of Nvidia's propriatery drivers. I use MythTV which means I need to leave my computer on all the time to record TV shows. This means daily I must execute "Alt+F2" then run "unity --replace" to reduce the rediculous memory footprint of "compiz" and to a lesser degree "unity-panel-service". The result is that using multiple workspaces becomes almost useless as all running apps are collapsed into the workspace where you ran the "unity --replace".

I surely hope this is fixed in 12.04, considering that Unity 3D is the default desktop and this is a LTS release.

Stan (llaen) wrote :

I'm experiencing the same problem with Xorg. I'm not even using compiz.

After resuming from a suspend, Xorg's memory usage increases and stays up until a restart.

Stephen A. Goss (postfuturist) wrote :

I'm on Ubuntu 12.04 64 bit. With 7 days of uptime, Compiz is using about 800 MB of memory. It's not enough of a leak to crash the desktop over the weekend, but still annoying.

Daniel van Vugt (vanvugt) wrote :

All - If you're using the radeon driver and find large leaks when the screen is locked, then please subscribe to bug 914773 instead.

Ari (ari-lp) wrote :

I can confirm this bug or maybe a similar one on Openbox/LXDE. After about 20h of uptime Xorg is now taking up 250 MiB of RAM. My experience with Unity/Compiz was similar.

Is there anything akin to "compiz --replace" for Xorg?

Additional information:

- Ubuntu 12.04.2 LTS
- Linux 3.2.0-36-generic
- AMD Mobility Radeon HD5650 on FGLRX (Catalyst 12.6)

Daniel van Vugt (vanvugt) wrote :


Please help us to figure out if this is Unity (which always occupies most of compiz' memory) or Compiz itself. Please:
  1. sudo apt-get install gnome-session-fallback
  2. Log out and log in to "Gnome Classic"
  3. Does the problem persist when logged into Gnome Classic?

Changed in unity:
status: Confirmed → Incomplete
Changed in unity (Ubuntu):
status: Confirmed → Incomplete

I have the same problem. After some time of use (some hours to some days, after some suspend/resume cycles) compiz and Xorg both reach around 500MB used RAM each. "compiz --replace" frees up compiz' used memory, but Xorg stays the same.

I had the same problem since forever (starting with natty and Nvidia 295 drivers) and now saucy (319-updates).

If I had to guess this seems to be more of a nvidia/Xorg problem, than a compiz problem.

Current system:
- Ubuntu 13.10, stock kernel (3.11.0-12-generic), proprietary Nvidia drivers (319-updates) on a NVS 5200M laptop GPU

Markus Lutz (markus-gmlutz) wrote :

I'm not sure, if it is correct to post here, but I had a similar problems since I updated to ubuntu 14.04 LTS (x86_64k). Sometimes I had more than 500MB for each compiz and xorg, which once summed up in 1,2 GB. The system was very slow, then I even thought it had been freezed (but it wasn't), even with a total memory of 4 GB.
I used the drivers form, installed the newest kernel, nothing seemed to help.

Finally I tried installing xserver-xorg-video-ati , which hadn't been installed, and voila now the system is fast again as it should be, although it seems as if the same driver (radeon) is used.

Current system:
Ubuntu 14.04 LTS (x86_64k), kernel 3.14.1, [AMD/ATI] RS880 [Radeon HD 4250], radeon graphic driver ( recent drivers from: )

To post a comment you must log in.