Unity leaks memory even when desktop is idle, screen locked in 12.10

Bug #1075614 reported by Stephen A. Goss
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Unity
Invalid
High
Unassigned
unity (Ubuntu)
Invalid
High
Unassigned

Bug Description

You can see the memory usage growing on my work computer over the weekend (not the spikes where I started using the machine, just the slow growth on Sat/Sun): http://imgur.com/DpDdO

That's all compiz, it leaks about 100 MB a day, even idle with the screen locked. I'm running Ubuntu 12.10 64 bit. That process will grow up to over 1.5 GB in a couple weeks and I'll have to reboot my machine just to reclaim memory. Normally I wouldn't care if apps leak some memory, but compiz is a core service, I haven't found a way to restart it without trashing my desktop.

description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please try installing package gnome-session-fallback and logging into Gnome Classic (Compiz without Unity). Does the problem still happen there? If not then it's a Unity problem (which runs inside compiz).

Changed in compiz:
status: New → Incomplete
Revision history for this message
Stephen A. Goss (postfuturist) wrote :

Oh that makes sense, has Unity ever not leaked memory? I've made the switch and I'll report back the status of memory leakage in a few days.

Revision history for this message
Stephen A. Goss (postfuturist) wrote :

I switched to Gnome Classic yesterday. After 22 hours up, compiz is sitting at a measly 30MB, so it does appear that Unity is likely the cause of the memory leak.

summary: - Compiz leaks memory even when desktop is idle, screen locked in 12.10
+ Unity leaks memory even when desktop is idle, screen locked in 12.10
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Nice work. Thanks for going to the trouble.

Changed in compiz:
status: Incomplete → New
affects: compiz → unity
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Note that this may be memory bloat rather than a leak. Most people write code that guarantees memory is freed on exit, so a leak is never detected. However a more common and harder to find problem is bloat, where the memory is allocated (and grows) for the lifetime of the process but is only freed on shutdown.

Changed in unity:
milestone: none → 7.0.0
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
Stephen A. Goss (postfuturist) wrote :

I left Gnome Classic on over the weekend, I can confirm no memory leak or "bloat" at all. I'm assuming that the memory "bloat" is memory you keep a reference to, instead of losing the reference without freeing. It seems like memory bloat would be trivially easy to track down. Let the program run, eventually 99% of the allocated memory will be the "bloaty" bits, you should be able to answer the question:

Where is it being allocated?

Where are the references being kept?

And then stop doing that.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's only trivial to track down if a developer can reproduce the bug at all. And often that's harder than you think.

Revision history for this message
jutaro (jnf-arcor) wrote :

Just wanted to shout out, that this bug affects me very much. I have to reboot almost daily when compiz has reached 4 GByte of RAM allocation! I tried out a lot of things like deactivating indicator applet etc. Maybe I have to get away from unity (again), when it will not be solved quickly.
That is not meant as a complain, but I vote to make this a high priority bug!

Changed in unity:
status: New → Confirmed
Revision history for this message
Stephen A. Goss (postfuturist) wrote :

The idle memory leak (or bloat) seems to not occur if I close Firefox and Chromium when I leave the computer on over the weekend. It doesn't get any leaked (or bloated) memory back, it just stops growing while the system is idle. So, maybe something about Firefox or Chromium is causing the leak (or bloat). I'm using the stock Firefox and Chromium that are available through the normal Ubuntu repos. If I remember, I'll try just leaving one of them open and seeing if I can narrow down which is the culprit.

Revision history for this message
Stephen A. Goss (postfuturist) wrote :

I left Firefox on over the weekend, compiz/unity ate all my RAM making my desktop unusable on Monday morning. Switching to Gnome Classic (No Effects) permanently.

Revision history for this message
Stephen A. Goss (postfuturist) wrote :

I asked a coworker who happens to be running Ubuntu with Unity desktop: "Open up System Monitor and tell me how much memory 'compiz' is using." His reply: "700 MB". I'm guessing a lot more folks are affected by this than even know, since most don't monitor memory usage. They probably just experience degraded system performance over time.

Changed in unity (Ubuntu):
importance: Undecided → High
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

The test you did with Firefox closed was in unity or compiz?

Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.0.0 → 7.0.1
Revision history for this message
Stephen A. Goss (postfuturist) wrote :

Marco: unity runs inside compiz, so both?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Stephen: yeah... But I was wondering if you were getting that with Gnome classic as well.

Revision history for this message
Stephen A. Goss (postfuturist) wrote :

Marco: I didn't see any memory bloat at all with Gnome Classic with compiz and Firefox running.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Mh, I've ran unity under valgrind's massif, but I didn't see anything abnormal here...

Could you try to run it in your setup?

I've just ran:
valgrind --tool=massif --depth=10 --max-snapshots=300 --time-unit=ms --alloc-fn=g_malloc --alloc-fn=g_realloc --alloc-fn=g_try_malloc compiz --replace

Changed in unity:
milestone: 7.0.1 → 7.3.1
Revision history for this message
Andrea Azzarone (azzar1) wrote :

@stephan, is this still a problem for you? Any update?

Changed in unity:
status: Confirmed → Incomplete
Changed in unity (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for unity (Ubuntu) because there has been no activity for 60 days.]

Changed in unity (Ubuntu):
status: Incomplete → Expired
Changed in unity (Ubuntu):
status: Expired → Incomplete
Andrea Azzarone (azzar1)
Changed in unity:
status: Incomplete → Invalid
Changed in unity (Ubuntu):
status: Incomplete → Invalid
Andrea Azzarone (azzar1)
Changed in unity:
milestone: 7.3.1 → none
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.