Pixmap memory leak in gtk-window-decorator

Bug #740258 reported by Tristan Tarrant
84
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Compiz Core
Fix Released
High
Sam Spilsbury
compiz (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: compiz

My Xorg process memory usage continues growing over time. Here it is after a few hours:

1498 root 20 0 426m 253m 20m S 12 6.4 12:10.87 Xorg

I have used xrestop to see where the memory is going. Here is the output:

xrestop - Display: :0.0
          Monitoring 42 clients. XErrors: 2
          Pixmaps: 215589K total, Other: 105K total, All: 215694K total

res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
1800000 100 67 1 1087 207 183021K 9K 183031K 2546 gtk-window-decorator

Is there anything else I need to do ?

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: compiz-gnome 1:0.9.4-0ubuntu7
ProcVersionSignature: Ubuntu 2.6.38-7.37-generic 2.6.38
Uname: Linux 2.6.38-7-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: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 270.30 Fri Feb 25 14:34:55 PST 2011
 GCC version: gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-6ubuntu4)
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,gnomecompat,wall,ezoom,workarounds,staticswitcher,resize,fade,scale,session,unityshell]
CompositorRunning: compiz
Date: Tue Mar 22 16:08:39 2011
DistUpgraded: Log time: 2010-11-18 10:24:48.680131
DistroCodename: natty
DistroVariant: ubuntu
DkmsStatus:
 vboxhost, 4.0.4, 2.6.38-7-generic, x86_64: installed
 vboxhost, 4.0.4, 2.6.38-6-generic, x86_64: installed
 vboxhost, 4.0.4, 2.6.35-28-generic, x86_64: installed
 nvidia-current, 270.30, 2.6.38-7-generic, x86_64: installed
ExecutablePath: /usr/bin/gtk-window-decorator
GraphicsCard:
 nVidia Corporation G96 [GeForce 9600M GT] [10de:0649] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Hewlett-Packard Company Device [103c:30f4]
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
InstallationMedia_: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
JockeyStatus: xorg:nvidia_current - NVIDIA accelerated graphics driver (Proprietary, Enabled, In use)
MachineType: Hewlett-Packard HP Pavilion dv7 Notebook PC
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, user)
 LANG=it_IT.utf8
 LC_MESSAGES=en_GB.utf8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-7-generic root=UUID=8aea5427-9676-455f-8569-759b319e00f7 ro quiet splash vt.handoff=7
ProcVersionSignature_: Ubuntu 2.6.38-7.37-generic 2.6.38
Renderer: Unknown
SourcePackage: compiz
UpgradeStatus: Upgraded to natty on 2010-11-18 (124 days ago)
XorgConf:
 #Section "ServerFlags"
 # Option "IgnoreABI" "1"
 #EndSection
dmi.bios.date: 08/24/2009
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: F.2C
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: 30F4
dmi.board.vendor: Compal
dmi.board.version: 99.B6
dmi.chassis.type: 10
dmi.chassis.vendor: Compal
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnHewlett-Packard:bvrF.2C:bd08/24/2009:svnHewlett-Packard:pnHPPaviliondv7NotebookPC:pvrF.2C:rvnCompal:rn30F4:rvr99.B6:cvnCompal:ct10:cvrN/A:
dmi.product.name: HP Pavilion dv7 Notebook PC
dmi.product.version: F.2C
dmi.sys.vendor: Hewlett-Packard
version.compiz: compiz 1:0.9.4-0ubuntu7
version.libdrm2: libdrm2 2.4.23-1ubuntu5
version.libgl1-mesa-glx: libgl1-mesa-glx 7.10.1-0ubuntu3
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg: xserver-xorg 1:7.6~3ubuntu11
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.0-0ubuntu4
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.14.0-4ubuntu4
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110107+b795ca6e-0ubuntu6

Revision history for this message
Tristan Tarrant (tristan-tarrant-gmail) wrote :
Revision history for this message
Omer Akram (om26er) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please try to obtain a valgrind log following the instructions at https://wiki.ubuntu.com/Valgrind and attach the file to the bug report. This will greatly help us in tracking down your problem.

Changed in compiz (Ubuntu):
status: New → Incomplete
Revision history for this message
kr0n (amundsen) wrote :

I have this problem to, just alt + tab with the application switcher plugin makes gtk-window-decorator consume more and more memory.

Im attachting the valgrind output of G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log compiz --replace

Let me know if i did it wrong.

This is with the xorg-server-video-ati drivers.

Revision history for this message
kr0n (amundsen) wrote :

Here is a log using the fglrx drivers instead.

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Re: [Compiz] [Bug 740258] Re: Pixmap memory leak in gtk-window-decorator

You'll need a valgrind log of the unity-window-decorator process.

On Thu, Apr 28, 2011 at 3:39 PM, kr0n <email address hidden> wrote:
> I have this problem to, just alt + tab with the application switcher
> plugin makes gtk-window-decorator consume more and more memory.
>
> Im attachting the valgrind output of G_SLICE=always-malloc G_DEBUG=gc-
> friendly  valgrind -v --tool=memcheck --leak-check=full --num-callers=40
> --log-file=valgrind.log compiz --replace
>
> Let me know if i did it wrong.
>
> This is with the xorg-server-video-ati drivers.
>
> ** Attachment added: "valgrind-ati.log"
>   https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/740258/+attachment/2092503/+files/valgrind-ati.log
>
> --
> You received this bug notification because you are a member of compiz
> packagers, which is subscribed to compiz in Ubuntu.
> https://bugs.launchpad.net/bugs/740258
>
> Title:
>  Pixmap memory leak in gtk-window-decorator
>
> _______________________________________________
> Mailing list: https://launchpad.net/~compiz
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~compiz
> More help   : https://help.launchpad.net/ListHelp
>

--
Sam Spilsbury

Revision history for this message
kr0n (amundsen) wrote :

Right, I assume that means the gtk-window-decorator process.

Here is one.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

No, I meant unity-window-decorator :) the two are very different :)

On Thu, Apr 28, 2011 at 6:22 PM, kr0n <email address hidden> wrote:
> Right, I assume that means the gtk-window-decorator process.
>
> Here is one.
>
> ** Attachment added: "valgrind.log"
>   https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/740258/+attachment/2092657/+files/valgrind.log
>
> --
> You received this bug notification because you are a member of compiz
> packagers, which is subscribed to compiz in Ubuntu.
> https://bugs.launchpad.net/bugs/740258
>
> Title:
>  Pixmap memory leak in gtk-window-decorator
>
> _______________________________________________
> Mailing list: https://launchpad.net/~compiz
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~compiz
> More help   : https://help.launchpad.net/ListHelp
>

--
Sam Spilsbury

Revision history for this message
kr0n (amundsen) wrote :

As requested :)

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Thanks for reporting this bug and any supporting documentation. Since this bug has enough information provided for a developer to begin work, I'm going to mark it as confirmed and let them handle it from here. Thanks for taking the time to make Ubuntu better!

I did not attempt to reproduce this issue. valgrind.log is attached for unity-window-decorator .

Changed in compiz (Ubuntu):
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
Pavel Fischer (rubbiroid) wrote :

Have the same bug. Simplest way to reproduce:
1. Set "Static Application Switcher" in Compiz as Application switcher
2. Open some Application
3. Open Task Manager
4. press Alt+Tab and look at Used Memory for gtk-window-decorator prozess

Revision history for this message
ThorX89 (thorx89) wrote :

Is there a workaround or a fix?

Revision history for this message
Lukáš Chmela (lukaschmela) wrote :

Yes, a workaround is to replace gtk-window-decorator with unity-window-decorator.

You can do it simply by pressing ALT+F2 and typing "gconf-editor", then navigating into "/apps/compiz-1/plugins/decor/screen0/options/" and changing the "command" key to "unity-window-decorator --replace".

Another way, however, non-persistent, is pressing ALT+F2 and typing directly "unity-window-decorator --replace &".
This way, the unity-window decorator would be replaced by the gtk one once Compiz is reloaded meaning that you would need to run this command on every login.

Hope this helps.

Revision history for this message
Lieven van der Heide (lievenvanderheide) wrote :

I fixed this one in lp:~lievenvanderheide/compiz/PixmapLeakFix. The problem seemed to be that the author assumed GdkPixmap's was reference counted like a GtkObject (ie, initially a floating reference, which must be ref'ed to become a real reference). GdkPixmap doesn't derive from GtkObject though, and so uses GObject reference counting, which means it has an initial ref count of 1. I removed the two g_object_ref lines from switcher.c, which seems to fix the leaks.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Indeed that was the case, I found that too when I was working on
rewriting the decorator anyways.

Thanks for the patch, the fix will be applied in oneiric.

On Sun, Aug 14, 2011 at 11:08 PM, Lieven van der Heide
<email address hidden> wrote:
> I fixed this one in lp:~lievenvanderheide/compiz/PixmapLeakFix. The
> problem seemed to be that the author assumed GdkPixmap's was reference
> counted like a GtkObject (ie, initially a floating reference, which must
> be ref'ed to become a real reference). GdkPixmap doesn't derive from
> GtkObject though, and so uses GObject reference counting, which means it
> has an initial ref count of 1. I removed the two g_object_ref lines from
> switcher.c, which seems to fix the leaks.
>
> --
> You received this bug notification because you are a member of compiz
> packagers, which is subscribed to compiz in Ubuntu.
> https://bugs.launchpad.net/bugs/740258
>
> Title:
>  Pixmap memory leak in gtk-window-decorator
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/740258/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~compiz
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~compiz
> More help   : https://help.launchpad.net/ListHelp
>

--
Sam Spilsbury

Changed in compiz-core:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → Sam Spilsbury (smspillaz)
milestone: none → 0.9.5.96
Revision history for this message
madbiologist (me-again) wrote :

Is this fix included in the recently released compiz 1:0.9.6+bzr20110929-0ubuntu2 which is in the Oneiric repositories?

Area there any plans for an SRU for Natty?

Changed in compiz-core:
milestone: 0.9.5.96 → 0.9.7.0
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.6 KiB)

This bug was fixed in the package compiz - 1:0.9.7.0~bzr2995-0ubuntu1

---------------
compiz (1:0.9.7.0~bzr2995-0ubuntu1) precise; urgency=low

  [ Didier Roche ]
  * New upstream snapshot:
    - Fix slow/stuttering display with fglrx (LP: #763005)
    - Don't dynamically link to compiz_core
    - Fix build failures with glib 2.30 (oneiric) (LP: #921406)
    - Fix uninitialized variable warnings in valgrind (LP: #921451)
    - Fixes up a bunch of boost::variant edge cases
    - Fixes a race condition where the xig restart test would fail spuriously
    - Incorrect (low/stuttering) refresh rate with NVIDIA driver (LP: #92599)
    - Benchmark window slows the system and degrades graphics resources
      (LP: #254561)
    - Windows that hide themselves when closed don't appear in any
      "this workspace" switcher (LP: #684731)
    - hang in g_spawn_sync and select() (LP: #690239)
    - word misspelled - bunding (LP: #694169)
    - sometimes, restored window placed too high. (LP: #716521)
    - Compiz clears the root window in the installer session (LP: #720679)
    - unity-window-decorator: When switching between windows, Orca does
      not speak the title of the focused window. (LP: #724093)
    - Cannot open a window that starts iconified (LP: #732997)
    - Minimize animation flickr when for maximized apps (LP: #737125)
    - Pixmap memory leak in gtk-window-decorator (LP: #740258)
    - Windows should not automatically be focused when opened if the
      focus is on another application (LP: #748840)
    - [sandybridge] Graphics tearing when playing video (LP: #755841)
    - Compiz's "Sync to Vblank" makes display stutter/slow with fglrx
      (LP: #763005)
    - [regression] Moving windows lags behind the mouse by 1-2 seconds;
      appear to freeze when dragging. (LP: #764330)
    - Launcher - Spread should not affect the state of window (LP: #764673)
    - Clicking on a tweet/message link sometimes does not work (LP: #790565)
    - scrolling on top of a close animation switches viewports (LP: #795065)
    - unity video tearing when moving windows in oneiric with
      nvidia-current (LP: #798868)
    - dialogs really slow to be displayed since the compiz update (LP: #812711)
    - It is possible to stack windows relative to windows that are
      destroyed (LP: #837252
    - Should keep list of windows last sent to server and last recv
      from server (LP: #841727)
    - compiz and X can disagree on the stacking order (LP: #845719)
    - A minimized window 'remains' behind on the desktop if
      /apps/compiz-1/plugins/unityshell/screen0/options/
      show_minimized_windows is set to true (LP: #847967)
    - maximized windows fail to update their input extents when
      undecorated (LP: #853734)
    - resizing bugs with xterm (LP: #854725)
    - crash on closing a window (LP: #856015)
    - Java application windows cut-off/truncated/not displayed properly
      (LP: #857201)
    - compiz crashed with SIGSEGV in CompScreen::insertServerWindow()
      (LP: #857487)
    - compiz crashed with SIGABRT in raise() (LP: #857738)
    - Applications which create multiple windows that are transients of
      each other...

Read more...

Changed in compiz (Ubuntu):
status: Triaged → Fix Released
Changed in compiz-core:
status: Fix Committed → Fix Released
Revision history for this message
positivek (anonyhole) wrote :

Still a problem in 14.04.1 LTS trusty.
Let me know what I can provide that would help localize the problem.

Revision history for this message
madbiologist (me-again) wrote :

positivek - Can you please tell the details of your Xorg process in top, and your xrestop output. See this bug's description for examples. Also please attach a Valgrind log of your unity-window-decorator process - see https://wiki.ubuntu.com/Valgrind and https://wiki.ubuntu.com/X/DebuggingWithValgrind

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.