compiz leaks memory, becomes sluggish and unusable after using it for few hours

Bug #813365 reported by Jean-Baptiste Lallement on 2011-07-20
122
This bug affects 25 people
Affects Status Importance Assigned to Milestone
Compiz
High
Unassigned
Unity
Fix Released
High
Tim Penhey
compiz (Ubuntu)
High
Unassigned
Oneiric
High
Unassigned
unity (Ubuntu)
Undecided
Unassigned
Oneiric
Undecided
Unassigned

Bug Description

Compiz leaks memory (see memory map evolution chart attached)
After a few hours, the whole desktop becomes slow (menus opening, window's content refresh, ...) to the point the user needs to restart the desktop.

I noticed that it eats more memory when I switch between desktop, which I use to do a lot during normal activity.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: compiz 1:0.9.5.0-0ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-5.6-generic 3.0.0-rc7
Uname: Linux 3.0.0-5-generic i686
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86 Kernel Module 275.09.07 Wed Jun 8 15:42:20 PDT 2011
 GCC version: gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-4ubuntu1)
Architecture: i386
CompizPlugins: [core,bailer,detection,composite,opengl,compiztoolbox,decor,gnomecompat,imgpng,regex,resize,mousepoll,vpswitch,grid,move,resizeinfo,place,snap,animation,session,wall,expo,workarounds,ezoom,staticswitcher,fade,scale,unityshell]
CompositorRunning: compiz
Date: Wed Jul 20 10:09:47 2011
DistUpgraded: Log time: 2009-11-14 16:29:16.249784
DistroCodename: oneiric
DistroVariant: ubuntu
DkmsStatus:
 nvidia-current, 275.09.07, 3.0.0-5-generic, i686: installed
 virtualbox, 4.0.10, 3.0.0-4-generic, i686: installed
 virtualbox, 4.0.10, 3.0.0-5-generic, i686: installed
EcryptfsInUse: Yes
GraphicsCard:
 nVidia Corporation G86 [GeForce 9300M G] [10de:042e] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: ASUSTeK Computer Inc. Device [1043:17c2]
JockeyStatus:
 xorg:nvidia_173 - NVIDIA accelerated graphics driver (Proprietary, Disabled, Not in use)
 xorg:nvidia_current - NVIDIA accelerated graphics driver (Proprietary, Enabled, Not in use)
 pkg:sl-modem-daemon - Software modem (Proprietary, Disabled, Not in use)
MachineType: ASUSTeK Computer Inc. U3SG
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-5-generic root=UUID=75f23f17-3ace-4485-af57-a7318eb6c2ff ro quiet splash vt.handoff=7
Renderer: Unknown
SourcePackage: compiz
UpgradeStatus: Upgraded to oneiric on 2011-07-12 (7 days ago)
dmi.bios.date: 01/28/2008
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 305
dmi.board.asset.tag: ATN12345678901234567
dmi.board.name: U3SG
dmi.board.vendor: ASUSTeK Computer Inc.
dmi.board.version: 1.0
dmi.chassis.asset.tag: ATN12345678901234567
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK Computer Inc.
dmi.chassis.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr305:bd01/28/2008:svnASUSTeKComputerInc.:pnU3SG:pvr1.0:rvnASUSTeKComputerInc.:rnU3SG:rvr1.0:cvnASUSTeKComputerInc.:ct10:cvr1.0:
dmi.product.name: U3SG
dmi.product.version: 1.0
dmi.sys.vendor: ASUSTeK Computer Inc.
version.compiz: compiz 1:0.9.5.0-0ubuntu1
version.libdrm2: libdrm2 2.4.26-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 7.11~1-0ubuntu4
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.11~1-0ubuntu4
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg: xserver-xorg 1:7.6+7ubuntu4
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.2-1ubuntu2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.15.0-3ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110411+8378443-1

Jean-Baptiste Lallement (jibel) wrote :
summary: - compiz leaks memory, becomes sluggish and unusable using it a few hours
+ compiz leaks memory, becomes sluggish and unusable after using it for
+ few hours
tags: added: 0.9.5.0
removed: 0.9.5
Didier Roche (didrocks) on 2011-07-20
Changed in compiz (Ubuntu):
assignee: nobody → Sam Spilsbury (smspillaz)
Sebastien Bacher (seb128) wrote :
Changed in compiz (Ubuntu):
assignee: Sam Spilsbury (smspillaz) → Canonical Desktop Experience Team (canonical-dx-team)
importance: Undecided → High
Changed in compiz:
assignee: nobody → Canonical Desktop Experience Team (canonical-dx-team)
importance: Undecided → High
Changed in compiz (Ubuntu):
status: New → Confirmed
Jean-Baptiste Lallement (jibel) wrote :

 I tried with 'Dialog Handler' enabled (which was not in the first case) and memory loss is around 58MB per hour.

Fabien Tassin (fta) wrote :

Here, the leak while idle is far smaller than before the last upgrade, but the leak in operation is far worse, even for small stuff like switching between two empty workspaces.
I can't have an active session of more than 2 hours before compiz crashes (somewhere in /usr/lib/nvidia-current/libnvidia-glcore.so.275.09.07). Then I'm left without w-m (respawning too fast). Even manually it crashes on start-up, until i restart Xorg.
Attached my trace.

Sebastien Bacher (seb128) wrote :

one issue on nvidia systems could be that cairo is built with gl enabled again and that the nvidia drivers lead to a few extra mb memory usage by gl process, which means each gtk application you open will hit your memory usage, those should not reflect on the compiz process use though but on each software rather

Jean-Baptiste Lallement (jibel) wrote :

Here is the graph, with 'Dialog Handler' disabled, and gtk-decorator instead of unity-decorator. All the non-default indicator were removed.
The shape is clearly different, after a rapid increase during the 1rst hour, the memory loss is much lower but still important ( ~13MB/hour)

I did the same test on a completely idle system (only default indicator, black screen), there is a leak but much smaller. Over 10 hours, there is a memory loss of 5.6MB/hour

Jean-Baptiste Lallement (jibel) wrote :

For reference, I'm now trying with an intel card instead of nVidia on the same system during normal use, no dialog handler and unity-decorator, to compare with test 1 and confirm if there is a link with the driver or not.

David Barth (dbarth) wrote :

Thanks a lot Fabien and Jean-Baptiste for collecting evidences of the problem.

Changed in unity:
assignee: nobody → Tim Penhey (thumper)
importance: Undecided → High
status: New → Triaged
milestone: none → 4.4.0
David Barth (dbarth) wrote :

@tim: this looks like a continuation of the investigation you made around crashers and leaks in compiz; i'd like your feedback on what can be the main sources of leaks in compiz and where to attack first. Seems to be related to the decorator, but where?

Here is the memory usage graph but I replaced the nVidia card (blob based driver) with an Intel graphics card on the exact same system.

It clearly shows that there is still a leak but a magnitude smaller than with nVidia since it is close to what is observed on an idled system (~6MB/hour)

David Barth (dbarth) on 2011-07-21
Changed in compiz (Ubuntu Oneiric):
assignee: Canonical Desktop Experience Team (canonical-dx-team) → Tim Penhey (thumper)
Didier Roche (didrocks) on 2011-07-21
Changed in unity:
milestone: 4.4.0 → 4.6.0
Tim Penhey (thumper) wrote :

I've managed to track and fix a number of leaks in both unity and nux since Friday, and I've just found another in nux. I'll be getting into the compiz code soon.

Changed in unity:
status: Triaged → In Progress
Didier Roche (didrocks) on 2011-08-01
Changed in unity:
milestone: 4.6.0 → 4.8.0
jerrylamos (jerrylamos) wrote :

Try Unity-2D. Doesn't use Compiz. Faster, crisp, way less overhead.
Or keep buying larger memory and faster PC's for Compiz to use. Your choice. Just like MacOS and Microsoft Windoze.

Jerry

Tony Mobily (tonymobily) wrote :

Hi,

Thumbs up if you can please fix this issue. I can confirm that switching between desktops is the problem here. To fix it, I go to text-mode console and issue a killall compiz or, worse, killall -9 compiz.

I will look into Unity-2d, I wasn't even aware of it...

Merc.

David Barth (dbarth) on 2011-08-30
Changed in unity:
milestone: 4.8.0 → 4.12.0
Changed in compiz:
assignee: Canonical Desktop Experience Team (canonical-dx-team) → nobody
Didier Roche (didrocks) on 2011-09-01
Changed in unity:
milestone: 4.12.0 → 4.14.0
Brad Figg (brad-figg) on 2011-09-02
tags: added: rls-mgr-o-tracking
Didier Roche (didrocks) on 2011-09-08
Changed in unity:
milestone: 4.14.0 → 4.16.0
Neil J. Patel (njpatel) wrote :

Hi all, can you update here your experience with unity 4.14.2-0ubuntu2? We are starting to find less and less leaks in Unity, the biggest one that is being chased right now is a leak in appmenu/dbusmenu. We need to start looking at graphics drivers leaking textures etc if Unity is still causing massive leaks for you. Thanks in advance!

Didier Roche (didrocks) on 2011-09-15
Changed in unity:
milestone: 4.16.0 → 4.18.0

Using the latest updates (no ppas) of oneiric and my previously affected i915 and nvidia glx 560 have been butter smooth. From boot compiz uses over 100 MB of RAM, though. It appears to STAY at 100 MB, though. All in all, I feel that huge performance issues have been fixed and now the large concern is the memory footprint.

Didier Roche (didrocks) on 2011-09-26
Changed in unity:
milestone: 4.18.0 → 4.20.0
Tim Penhey (thumper) wrote :

As far as I'm concerned, the unity part of this is done for now.

Changed in unity:
status: In Progress → Fix Committed
Changed in compiz (Ubuntu Oneiric):
assignee: Tim Penhey (thumper) → nobody
Tim Penhey (thumper) on 2011-09-26
Changed in unity:
status: Fix Committed → Fix Released
Changed in compiz:
status: New → Fix Released
Changed in compiz (Ubuntu Oneiric):
status: Confirmed → Fix Released
sds (sds-gnu) wrote :

the bug is still there with Version: 1:0.9.6+bzr20110929-0ubuntu6:
2110 sds 20 0 1748m 739m 17m S 30 9.4 2013:00 compiz
1.7Gig of virtual memory is a little bit too much for a window manager.

Still there for me with nvidia-current from ppa:ubuntu-x-swat/x-updates

compiz virtual mem 1.2GB and constant 30% cpu.

chris@chris:~$ sudo dpkg -l | grep compiz
ii compiz 1:0.9.7.8-0ubuntu1 OpenGL window and compositing manager
ii compiz-core 1:0.9.7.8-0ubuntu1 OpenGL window and compositing manager
ii compiz-gnome 1:0.9.7.8-0ubuntu1 OpenGL window and compositing manager - GNOME window decorator
ii compiz-plugins-default 1:0.9.7.8-0ubuntu1 OpenGL window and compositing manager - default plugins
ii compiz-plugins-main-default 1:0.9.7.0~bzr19-0ubuntu10 Compiz plugins - main default collection
ii compizconfig-backend-gconf 0.9.5.92-0ubuntu5 Compiz Fusion configuration system - gconf backend
ii libcompizconfig0 0.9.7.0~bzr428-0ubuntu6 Settings library for plugins - OpenCompositing Project

chris@chris:~$ uname -a
Linux chris 3.2.0-24-generic #39-Ubuntu SMP Mon May 21 16:52:17 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

chris@chris:~$ sudo dpkg -l | grep nvidia
ii nvidia-common 1:0.2.44 Find obsolete NVIDIA drivers
ii nvidia-current 295.53-0ubuntu1~precise~xup1 NVIDIA binary Xorg driver, kernel module and VDPAU library
ii nvidia-settings 295.53-0ubuntu1~precise~xup1 Tool of configuring the NVIDIA graphics driver

top:
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 2394 chris 20 0 1278m 177m 49m S 30 3.0 3:30.54 compiz
 1490 root 20 0 163m 58m 20m S 4 1.0 1:27.83 Xorg

papukaija (papukaija) wrote :

Please open a new bug if you still have memory issues with compiz (PPAs are unsupported though). Thanks.

Florian Boucault (fboucault) wrote :

I believe this is affecting me still. Is there any new bug report for the issue?

Daniel van Vugt (vanvugt) wrote :

Florian,

Please do log a new bug if any problem persists. Note however that bugs about performance which lack either:
  (a) very detailed steps of what works and what does not; or
  (b) profile output / call stacks
Are usually too vague to every be resolved.

The more scientific the bug report, the more likely we can find the root cause and fix it :)

Changed in unity (Ubuntu):
status: New → Fix Released
Rolf Leggewie (r0lf) wrote :

oneiric has seen the end of its life and is no longer receiving any updates. Marking the oneiric task for this ticket as "Won't Fix".

Changed in unity (Ubuntu Oneiric):
status: New → Won't Fix
To post a comment you must log in.