Huge memory leak in metacity

Bug #774740 reported by Pako on 2011-05-01
This bug affects 21 people
Affects Status Importance Assigned to Milestone
metacity (Ubuntu)

Bug Description

Binary package hint: metacity

Metacity uses 72Mb. of RAM. Ubuntu 11.04 Classic desktop

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: metacity 1:2.30.3-0ubuntu8
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic
Uname: Linux 2.6.38-8-generic i686
Architecture: i386
Date: Sun May 1 11:30:38 2011
ExecutablePath: /usr/bin/metacity
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
SourcePackage: metacity
UpgradeStatus: No upgrade log present (probably fresh install)

Pako (elektrobank01) wrote :
Pako (elektrobank01) wrote :
description: updated
sirjeppe (sirjeppe) wrote :

I got as much as 2,6 gig allocated for this process :/

I'm on Ubuntu 11.04, 64-bit.

Pako (elektrobank01) on 2011-05-13
summary: - metacity memory usage
+ Huge memory leak in metacity
Pedro Villavicencio (pedro) 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 and attach the file to the bug report. This will greatly help us in tracking down your problem.

Changed in metacity (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
thaMANSTA (thamansta) wrote :
Download full text (3.3 KiB)

Same thing here. Screenshot attached, lshw output below.

$ uname -a
Linux trogdor 2.6.38-9-generic #43-Ubuntu SMP Thu Apr 28 15:23:06 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

$ sudo lshw -short
H/W path Device Class Description
                           system GA-770T-USB3 ()
/0 bus GA-770T-USB3
/0/0 memory 128KiB BIOS
/0/4 processor AMD Phenom(tm) II X4 955 Processor
/0/4/a memory 128KiB L1 cache
/0/4/c memory 512KiB L3 cache
/0/b memory 128KiB L1 cache
/0/25 memory 4GiB System Memory
/0/25/0 memory 2GiB DIMM 1333 MHz (0.8 ns)
/0/25/1 memory DIMM 400 MHz (2.5 ns) [empty]
/0/25/2 memory 2GiB DIMM 1333 MHz (0.8 ns)
/0/25/3 memory DIMM 400 MHz (2.5 ns) [empty]
/0/100 bridge RX780/RX790 Chipset Host Bridge
/0/100/2 bridge RD790 PCI to PCI bridge (external gfx0 port A)
/0/100/2/0 display Cedar PRO [Radeon HD 5450]
/0/100/2/0.1 multimedia Manhattan HDMI Audio [Mobility Radeon HD 5000 Series]
/0/100/9 bridge RD790 PCI to PCI bridge (PCI express gpp port E)
/0/100/9/0 bus uPD720200 USB 3.0 Host Controller
/0/100/a bridge RD790 PCI to PCI bridge (PCI express gpp port F)
/0/100/a/0 eth0 network RTL8111/8168B PCI Express Gigabit Ethernet controller
/0/100/11 scsi0 storage SB7x0/SB8x0/SB9x0 SATA Controller [IDE mode]
/0/100/11/0 /dev/cdrom disk CDDVDW SH-S223C
/0/100/11/1 /dev/sda disk 500GB WDC WD5002AALX-0
/0/100/11/1/1 /dev/sda1 volume 18GiB EXT4 volume
/0/100/11/1/2 /dev/sda2 volume 447GiB EXT4 volume
/0/100/12 bus SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
/0/100/12.1 bus SB7x0 USB OHCI1 Controller
/0/100/12.2 bus SB7x0/SB8x0/SB9x0 USB EHCI Controller
/0/100/13 bus SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
/0/100/13.1 bus SB7x0 USB OHCI1 Controller
/0/100/13.2 bus SB7x0/SB8x0/SB9x0 USB EHCI Controller
/0/100/14 bus SBx00 SMBus Controller
/0/100/14.1 storage SB7x0/SB8x0/SB9x0 IDE Controller
/0/100/14.2 multimedia SBx00 Azalia (Intel HDA)
/0/100/14.3 bridge SB7x0/SB8x0/SB9x0 LPC host controller
/0/100/14.4 bridge SBx00 PCI to PCI Bridge
/0/100/14.4/e bus TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
/0/100/14.5 bus SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
/0/101 bridge Family 10h Processor HyperTransport Configuration
/0/102 bridge Family 10h Processor Address Map
/0/103 bridge Family 10h Processor DRAM Controller
/0/104 ...


thaMANSTA (thamansta) wrote :

even worse after a few days... see attached photo

Changed in metacity (Ubuntu):
status: Incomplete → Confirmed
Pedro Villavicencio (pedro) wrote :

we still need a valgrind log.

Changed in metacity (Ubuntu):
status: Confirmed → Incomplete
thaMANSTA (thamansta) wrote :

What's the best way to get the valgrind log for Metacity? i.e. As it auto-launches at login to X, how do I get X to call it through Valgrind?


thaMANSTA (thamansta) wrote :

Just killall'd it and ran it from the command line. Here you go.

moragos (moragos) wrote :

just saw this bug happening here as well.
I see you already have a valgrind log, do you need another?
is there anything else I can help with?

Sam Liddicott (sam-liddicott) wrote :

A temporary fix is, every few days (or when you swap space is nearly all used up):

pkill metacity ; sleep 1 ; metacity

it saves one logging out or rebooting

Matej Mo (mo-cgraphics) wrote :

I also confirm this memory leak. Ubuntu 11.04 64 bit

Simon IJskes (sim-nyx) wrote :

I can also confirm this memory leak:

Architecture: amd64
Version: 1:2.30.3-0ubuntu8

I have to regularly reboot metacity with a laucher icon with 'metacity --replace'.

Simon IJskes (sim-nyx) wrote :

There seems to be a relation to missing redraw rectangles and metacity getting slower/collecting much memory.

Why does metacity collect so much pixmap memory?

sirjeppe (sirjeppe) wrote :

Yes, I definitely see redraw issues as well! Would be fantastic if they were related and was solved by solving this issue :)

tglman (tglman) on 2011-09-12
Changed in metacity (Ubuntu):
status: Incomplete → In Progress
assignee: nobody → tglman (tglman)
tglman (tglman) wrote :

With valgrind log i found the leak and patch it, sameone know how push the patch to main stream?
I insert the patch as attachment.

I use the patched version by 6 hours without restart and no memory usage increase, before every 2-3 hours i must restart metacity.

The attachment "Bug #774740.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch

temporary fix is (when metacity used mach memory)
metacity-message restart

Oliver Joos (oliver-joos) wrote :

I confirm this bug using 11.04 on a laptop with Radeon Mobility X600.
The temporary fix of comment 18 works as a charm: metacity memory consumption just went from 283 MB to 14 MB!

I applied the patch #778727 on ubuntu 11.04 64-bit.

It does fix the memory leak problem (metacity used to consume ~4GB of mem while with the patch never exceeds 5MB).
However, it introduces a new problem. Alt-tab functionality to switch between processes is now broken.
Every time I press Alt-tab it seems as if it redraws the windows and leaves me in the same one.

Interestingly, if I have two terminals and press alt-tab continuously the terminals are moving downwards.


Changed in metacity (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers