indicator-multiload causes a memory leak in compiz when run under unity

Bug #779717 reported by Doug McMahon
494
This bug affects 97 people
Affects Status Importance Assigned to Milestone
System Load Indicator
Fix Released
High
Michael Hofmann
Unity
Fix Released
High
Michael Hofmann
unity (Ubuntu)
Fix Released
Undecided
Unassigned
Natty
Won't Fix
Undecided
Unassigned

Bug Description

Uploaded in unity 3.8.14-0ubuntu1~natty1:

Test case:
1. ensure you have indicator-multiload loaded
2. install unity 3.8.14-0ubuntu1~natty1 from natty-proposed and restart your session
3. check the memory taken by unity it shouldn't increase as much (still some memory leak) than showed below

While indicator-multiload itself remains static, while it is running memory use in compiz increases about 1MB/min (RSS
Attached is pidstat log showing at idle for about 4 min, the indicator started and ruuning for about the same, then stopped and back at idle for a couple of min.

This is a bug in compiz/unity (bug #720446, bug #758248), and can't be fixed in system load indicator.

Related branches

Revision history for this message
Doug McMahon (mc3man) wrote :
Revision history for this message
Michael Hofmann (mh21) wrote :

The original bug is unity bug #720446.

This does not happen when run
- in a classic session with indicator-application
- in a classic session without indicator-application, just with a system tray
- in a classic session without indicator-application, with stalonetray as a standalone systemtray

summary: - indicator-multiload causes a memory leak in compiz
+ indicator-multiload causes a memory leak in compiz when run under unity
Revision history for this message
Christoph Buchner (bilderbuchi) wrote :

Regarding comment #44 in the other bug report (possible cause for memleak may be an icon cache) I can add that decreasing the refresh interval of indicator-multiload increases the rate of rising mem usage.
At a refresh interval of 100ms, with cpu and ram graphs active, compiz mem usage rises at a clip of about 7 seconds per megabyte. Does this sound reasonable regarding the sizes of the icons, Michael?
A temporary workaround for now could be to set a longer refresh interval. Also, shouldn't this bug also set "affects compiz", as per the reasoning in comment #44?

Revision history for this message
Christoph Buchner (bilderbuchi) wrote :

and by "affects compiz" i actually meant "affects unity". :-P

Revision history for this message
Michael Hofmann (mh21) wrote :

I think we will leave compiz/unity to bug #720446.

Regarding the size: the icons in /var/lock/multiload-XXXXXX are tiny, in memory with truecolor e.g. 3graphs*30px*22px*rgba ~ 9k, so that would be 90k/second with 100ms refresh, about 11 seconds/megabyte. So that sounds about right.

Revision history for this message
Mohammad Razavi (mrazavi) wrote :

I have attached two simple python scripts to demonstrate the bug!

compiz memory usage begin to grow when the indicator start changing its text. (indicator-nobug.py replace its text at the same rate!)

Run the scripts while indicator-multiload is not running.

Revision history for this message
exleper (exleper) wrote :

just to confirm, with multiload-indicator running compiz mem usage rises rapidly and after a day at about 1 gig, without multiload it stays at around 80-90mb

Changed in indicator-multiload:
status: New → Confirmed
Revision history for this message
slibuntu (stuohy1) wrote :

I can confirm this bug. Using unity in natty, and indicator version 0.1

Revision history for this message
KoRnKloWn (kornklown) wrote :

I also confirm this, however it's REALLY bad on my computer. I have Ubuntu 11.04 64 bit, and after a few hours, Compiz peaks at about 2.4 Gb, the memory goes up a few Mbps. I don't think it's necessary for me to submit any logs, enough people have done that, I wouldn't be showing anything new. However I'm posting this to add the list of people that want this fixed, I love the multi-load monitor! However I also like how I have Unity set up, and I don't want to use classic Ubuntu.

Please fix multi-load monitor! Thanks.

Revision history for this message
Christian Dysthe (christian-dysthe) wrote :

Bug confirmed.

Michael Hofmann (mh21)
description: updated
Revision history for this message
Omer Akram (om26er) wrote :

I reported bug 786425 for Unity for this issue but later found that there was already a bug for the indicator. if the bug is in indicator plz mark the Ubuntu task that I just opened as invalid.

Revision history for this message
Peter Petersson (petersson-peter) wrote :

After inactivating indicator-multiload compiz is a lot less aggressive in eating memory, indicator-multiload is either doing something wrong that causes memory leaks in compiz (under Unity) or is in heavy use of some api function that causes this substantial memory leak. Reports about this leak has also been done in https://bugs.launchpad.net/bugs/758248

Revision history for this message
Michael Hofmann (mh21) wrote :

Yes, the api function is app_indicator_set_icon(...), but the problem is on the side of the program showing the indicators.

It works ok with indicator-application/gnome-panel, but causes a leak in unity/compiz.

description: updated
Revision history for this message
Michael Hofmann (mh21) wrote :

Valgrind log for unity/compiz at https://launchpadlibrarian.net/72194098/valgrind.log (from bug #786425):
==2761== 2,305,980 (45,084 direct, 2,260,896 indirect) bytes in 867 blocks are definitely lost in loss record 11,053 of 11,054
==2761== ...
==2761== by 0x939692C: gdk_pixbuf_new
==2761== ...
==2761== by 0x7DBE846: IndicatorObjectEntryProxyRemote::GetPixbuf()
==2761== by 0x7DEF2F1: PanelIndicatorObjectEntryView::Refresh()
==2761== ...
==2761== by 0x7DBEF60: IndicatorObjectEntryProxyRemote::Refresh(...)
==2761== by 0x7DC24B6: IndicatorObjectProxyRemote::AddEntry(...)
==2761== by 0x7DC1156: IndicatorObjectFactoryRemote::Sync(...)
==2761== ...

Revision history for this message
Mohammad Razavi (mrazavi) wrote :

This bug is definitely not related to indicator-mulitload. Any indicator that change its icon or text regularly could increase compiz process memory usage. My simple script (Post #6) could verify this fact.

Revision history for this message
Michael Hofmann (mh21) wrote :

If you feel adventurous, you can installed a patched unity from ppa:mh21/ppa that should contain a fix for the leak.

Revision history for this message
Michael Hofmann (mh21) wrote :

Please provide feedback here whether it works for you or not, so that we can push the patch to unity upstream.

Revision history for this message
Michael Hofmann (mh21) wrote :

Slightly updated patch that fixes another (minor) memory leak.

tags: added: patch
Revision history for this message
Omer Akram (om26er) wrote : Re: [Bug 779717] Re: indicator-multiload causes a memory leak in compiz when run under unity

Michael with your unity I am not seeing the memory leak when
indicator-multiload is running. although I have tested for a few
minutes(still running) but in non-patched unity the memory leak was
instantaneous

On Tue, May 24, 2011 at 10:35 PM, Brian Murray <email address hidden> wrote:
> ** Tags added: patch
>
> --
> You received this bug notification because you are subscribed to unity
> in Ubuntu.
> https://bugs.launchpad.net/bugs/779717
>
> Title:
>  indicator-multiload causes a memory leak in compiz when run under
>  unity
>
> Status in System Load Indicator:
>  Confirmed
> Status in “unity” package in Ubuntu:
>  New
>
> Bug description:
>  While indicator-multiload itself remains static, while it is running memory use in compiz increases about 1MB/min (RSS
>  Attached is pidstat log showing at idle for about 4 min, the indicator started and ruuning for about the same, then stopped and back at idle for a  couple of min.
>
>  This is a bug in compiz/unity (bug #720446, bug #758248), and can't be
>  fixed in system load indicator.
>

Revision history for this message
Derek Monner (dmonner) wrote :

With Michael's patch I've had Unity running with indicator-multiload for almost 20 minutes now with no noticeable memory leak. Looks like you got it, Michael. Thanks!

Revision history for this message
Michael Hofmann (mh21) wrote :

I pushed the updated unity packages to ppa:indicator-multiload/daily and ppa:indicator-multiload/stable-daily until the patch lands in unity.

Changed in indicator-multiload:
assignee: nobody → Michael Hofmann (mh21)
importance: Undecided → High
status: Confirmed → Fix Committed
Revision history for this message
Bowmore (bowmore) wrote :

What about oneiric?
Is the fix ported via ppa:indicator-multiload/daily for oneiric too or mainstream?

Revision history for this message
Michael Hofmann (mh21) wrote :

The package is only natty.

For oneiric, it makes more sense to push it upstream as fast as possible.

Michael Hofmann (mh21)
Changed in indicator-multiload:
status: Fix Committed → Confirmed
Revision history for this message
Peter Petersson (petersson-peter) wrote :

You ar right Mohammad its not idicator-multiload as such but its heavy
usage of a api function that adds a icon img to the Unity panel.
The indicator-multiload "applet" adds a new icon img every second
without making sure the referece to to the img is really released.
This may be a flaw in the api or a miss usage of the same.
I have not looked at your scripts but maybe there is a way for you to
take care of the "text" leak by unreference or clean up ref to it somehow?

On 2011-05-24 17:05, Mohammad Razavi wrote:
> This bug is definitely not related to indicator-mulitload. Any
> indicator that change its icon or text regularly could increase compiz
> process memory usage. My simple script (Post #6) could verify this fact.
>

Changed in unity:
milestone: none → 3.8.14
importance: Undecided → High
status: New → Triaged
Changed in unity (Ubuntu):
status: New → Triaged
Changed in unity:
assignee: nobody → Michael Hofmann (mh21)
Revision history for this message
Jimmy Merrild Krag (beruic) wrote :

Ok, I installed Unity the update from ppa:indicator-multiload/daily, now most of the memory leak seems gone.
Both Expo and Spread mode does not seem to memory leak anymore.
However, opening the dash will increase the memory of Compiz by approximately 200 to 800 kb every time. This does not get garbage collected.

Revision history for this message
Jimmy Merrild Krag (beruic) wrote :

Maybe I should mention too that before when I logged in, the memory usage of Compiz was usually around 30 mb.
Now it starts of around 40 and crawls up a bit for every program I open. It doesn't seem to get garbage collected, so I can increase the memory usage of Compiz by simply opening and closing windows.

Revision history for this message
Michael Hofmann (mh21) wrote :

The patch only affects indicators, it should not improve things for anything else...

Revision history for this message
Jimmy Merrild Krag (beruic) wrote :

I guess I had these issues before without noticing then.

Revision history for this message
Jimmy Merrild Krag (beruic) wrote :

Just noticed that after some time, Compiz actually went under 40 mb. I can however make it rise and rise by opening and closing Dash repeatedly. Also, I have around 300 mb swap, so could some of the memory go there?

Revision history for this message
GonzO (gonzo) wrote :

Patched Unity is... better.

There's still a leak, somewhere, with Dashes and Lenses. But I don't think that's your problem.

Revision history for this message
Felipe Castillo (fcastillo.ec) wrote :

@Jimmy Merrild I can't update unity from ppa:indicator-multiload/daily, the version is lower than the unity-updates, if I try to force a version of the package Unity, unity-desktop gets uninstall and hence unity gets uninstall, so it's impossible to update.
I think the version number and the dependencies in unity-desktop package should be fixed so I can update unity from the ppa.

Revision history for this message
Philippe Le Rohellec (philippe-lerohellec) wrote :

I'm not using multiload indicator but I was experiencing the compiz memory leak with more than 100MB lost every day. I installed the ppa:indicator-multiload/daily PPA and I can confirm it plugs the leak almost entirely, only 4MB were lost in the past 15 hours.

Revision history for this message
Jimmy Merrild Krag (beruic) wrote :

@Felipe: Strange. I have both Michaels and the Unity ppa enabled, and I get the patched version from Michaels ppa.
Seems like Michael made a new build in his ppa just now. Does this one go through for you?

Revision history for this message
Michael Hofmann (mh21) wrote :

Yeah, the last unity version in the ppa was built with debug information enabled, so I'm sorry if Unity felt a little bit slower than usual :-(.

Should be fixed now, and as long as there is no 3.8.12-0ubuntu2 version in the ubuntu archive the ppa unity version (3.8.12-0ubuntu2~mh3) should get installed.

Revision history for this message
Felipe Castillo (fcastillo.ec) wrote :

@Jimmy I got the last update of indicator-multiload but unity doesn't get updated, I still have the same problem. My system sees that there's a new version and the only way is to force it just to produce the same behavior than before.
The only thing I've notice is that I don't have the Unity ppa enabled, could you provide me the ppa? Maybe that's what's not letting me install it. Is this the ppa "ppa:unity/ppa"?

Nonetheless, I think this is a bug because not everybody should have the unity ppa in order to get this update. And if it is required then you should say it somewhere.

Revision history for this message
Felipe Castillo (fcastillo.ec) wrote :

I've added the Unity ppa, and I can't install the pacakge unity 3.8.12-0ubuntu2~mh3.
I downloaded manually the .deb file (from Michael ppa), try to install it and then I realize the problem, I got the message:

Dependency is not satisfiable: unity-common (= 3.8.12-0ubuntu2~mh3)

So, I went again to the ppa, downloaded manually unity-common 3.8.12-0ubuntu2~mh3, try to install it. But to my surprise I get the message:

Breaks existing package 'unity' dependency unity-common (= 3.8.12-0ubuntu1)

So, that's why when I try to Force the version in the package Unity, I get as a result the same package being uninstalled.

So as I workaround, I had to uninstall the package Unity, then force the new version in unity-common, and then force the version in unity, because with a normal update I wouldn't get unity-common updated either.
Why did I have this problem? Did anybody else had it? Am I going to have any future problems if I have to update those packages again?

Revision history for this message
Omer Akram (om26er) wrote :

download unity and unity-common from the ppa. cd to the dir where they
are downloaded and try. sudo dpkg -i unity*

On Sun, May 29, 2011 at 10:55 PM, Felipe Castillo
<email address hidden> wrote:
> I've added the Unity ppa, and I can't install the pacakge unity  3.8.12-0ubuntu2~mh3.
> I downloaded manually the .deb file (from Michael ppa), try to install it and then I realize the problem, I got the message:
>
> Dependency is not satisfiable: unity-common (= 3.8.12-0ubuntu2~mh3)
>
> So, I went again to the ppa, downloaded manually unity-common
> 3.8.12-0ubuntu2~mh3, try to install it. But to my surprise I get the
> message:
>
> Breaks existing package 'unity' dependency unity-common (=
> 3.8.12-0ubuntu1)
>
> So, that's why when I try to Force the version in the package Unity, I
> get as a result the same package being uninstalled.
>
> So as I workaround, I had to uninstall the package Unity, then force the new version in unity-common, and then force the version in unity, because with a normal update I wouldn't get unity-common updated either.
> Why did I have this problem? Did anybody else had it? Am I going to have any future problems if I have to update those packages again?
>
> --
> You received this bug notification because you are subscribed to unity
> in Ubuntu.
> https://bugs.launchpad.net/bugs/779717
>
> Title:
>  indicator-multiload causes a memory leak in compiz when run under
>  unity
>
> Status in System Load Indicator:
>  Confirmed
> Status in Unity:
>  Triaged
> Status in “unity” package in Ubuntu:
>  Triaged
> Status in “unity” source package in Natty:
>  New
>
> Bug description:
>  While indicator-multiload itself remains static, while it is running memory use in compiz increases about 1MB/min (RSS
>  Attached is pidstat log showing at idle for about 4 min, the indicator started and ruuning for about the same, then stopped and back at idle for a  couple of min.
>
>  This is a bug in compiz/unity (bug #720446, bug #758248), and can't be
>  fixed in system load indicator.
>

Changed in unity (Ubuntu Natty):
status: New → Triaged
Changed in unity:
status: Triaged → Fix Committed
Changed in unity (Ubuntu):
status: Triaged → Fix Released
description: updated
tags: added: verification-needed
Revision history for this message
David Barth (dbarth) wrote :

Fix Released in SRU1, ignore the invalid tag (I can't undo that right now)

Changed in unity:
milestone: 3.8.14 → 3.8.16
status: Fix Committed → Fix Released
Michael Hofmann (mh21)
Changed in indicator-multiload:
status: Confirmed → Fix Released
Revision history for this message
Christian Dysthe (christian-dysthe) wrote :

I'm still having a memory leak problem with this indicator. It's not as bad as it was, but compiz's memory usage goes up to around 400 mb after about 10 hours of running the indicator. Without it running Compiz stays around 100 MB at all times.

Revision history for this message
Michael Hofmann (mh21) wrote :

cdysthe, care to do some more research for your case?

- Could you attach the output of "dpkg -l 'compiz*' 'unity*' indicator-multiload"?
- Could you check whether this problem gets worse when you decrease the update interval (e.g. 100ms)?
- Could you run compiz with valgrind like this "valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log compiz --replace" and (after it reaches 400mb :-) attach the output here?

Revision history for this message
d4v1dv00 (davidvoo) wrote :

running indicator-multiload 0.2 and compiz stays at 100MB RAM usage, does this normal for 100MB of mem consumption?

Revision history for this message
sds (sds-gnu) wrote :

compiz and indicators hog memory like crazy:

$ ps -Fwww -C compiz
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
sds 27843 27760 12 160313 125432 0 10:46 ? 00:08:25 compiz
$ ps -FAwww | grep indi
sds 2836 11186 0 3355 600 2 11:52 pts/3 00:00:00 grep indi
sds 27868 27760 0 95531 29636 1 10:46 ? 00:00:00 /usr/bin/python /usr/bin/indicator-weather
sds 27871 27760 0 69168 11496 1 10:46 ? 00:00:30 /usr/bin/indicator-multiload
sds 27940 1 0 58571 4884 1 10:46 ? 00:00:10 /usr/lib/indicator-application/indicator-application-service
sds 27942 1 0 64591 6244 1 10:46 ? 00:00:00 /usr/lib/indicator-messages/indicator-messages-service
sds 27954 1 0 76706 7772 0 10:46 ? 00:00:00 /usr/lib/indicator-datetime/indicator-datetime-service
sds 27955 1 0 84071 6828 3 10:46 ? 00:00:00 /usr/lib/indicator-sound/indicator-sound-service
sds 27957 1 0 81532 5844 0 10:46 ? 00:00:00 /usr/lib/indicator-session/indicator-session-service
sds 27974 27760 0 35695 3944 3 10:46 ? 00:00:00 telepathy-indicator

Revision history for this message
Ivan Zakharyaschev (imz) wrote :

Could you please help me to decide whether this bug affects Ubuntu 12.04?

I found out the information about the indicator-multiload at http://askubuntu.com/a/40019/19753 (which turned out to be the thing I have been missing in my installation of Ubuntu 12.04 for Toshiba AC100), but then I saw the comment warning about this memory leak bug.

I've read the comments here, seen that some fix has been comitted, but I can't understand whether this fix got into the repository for Ubuntu 12.04, so that I can install this indiciator without being afraid of this memory leak. What is the quick way to check this?

Revision history for this message
Felix Dreissig (f30) wrote :

@imz: I personally havent't experienced any memory leaks with indicator-multiload for quite a long time now (even before 12.04). It definitely seems to be an issue of former times.
Besides, in case you didn't know, the tool is now available in the official Ubuntu software repositories as well.

Revision history for this message
Davide Baroncelli (baroncelli-gmail) wrote :

Just for the record, yesterday after a few days running, I had to kill indicator-multiload with it consuming 6GB of memory. This is on Ubuntu 12.04 and Unity.

Revision history for this message
TZ (tim-zander) wrote :

I had the same as https://bugs.launchpad.net/indicator-multiload/+bug/779717/comments/45 today. Killed indicator-multiload with 1.2GB memory used. Uptime 8 days

Revision history for this message
Andreas Jonsson (sonofjon) wrote :

I had memory leaks (up to 400 MB) until a few weeks ago using unity in 12.04. With the latest update (0.3-0+66~32~17~precise1) from http://ppa.launchpad.net/indicator-multiload/stable-daily/ the memory leak has completely disappeared.

Revision history for this message
Andreas Jonsson (sonofjon) wrote :

Temporary workaround for those still having problems: Run this script in the background to restart indicator-multiload every hour:

#!/bin/sh

export DISPLAY=:0

while true
do
    killall -q indicator-multiload
    /usr/bin/indicator-multiload >/dev/null 2>&1 &
    sleep 3600
done

Revision history for this message
GouZi (jalliot) wrote :

0.3-0+66~32~17~precise1 from http://ppa.launchpad.net/indicator-multiload/stable-daily/ did not fix the problem for me.
The indicator-multiload leaks memory at a rate of ~0.1MB every 10 sec.
Running 12.04 x86_64.

Revision history for this message
Ilya Schurov (ily2) wrote :

Same as comment #49: leak is not fixed in indicator-multiload 0.3-0+66~33~17~precise1, unity 5.16.0-0ubuntu1, compiz 1:0.9.7.8-0ubuntu1.4

Revision history for this message
Christian Dysthe (christian-dysthe) wrote :

I can confirm that the memory leak is still appearant in a fresh Ubuntu 12.04 install. A restart brings it back to normal for a while, but then it takes off towards 1 GB again.

Revision history for this message
Sebastian (slovdahl) wrote :

I can also confirm that the memory leak still exists. I have a uptime of 12 days now, and the indicator-multiload process used 49,9% of my memory (12 GB).

Revision history for this message
Andreas Jonsson (sonofjon) wrote :

Another change that I applied around the same time as when my memory leak stopped appearing was to reduce the "System monitor width" value to 30 pixels from the default value. I'm not sure how that could be related, but I thought I'd mention it since the memory leak disappeared around the same time as I applied that change. Could be a red herring though.

Revision history for this message
GouZi (jalliot) wrote :

Wow, changing the "System monitor width" seems indeed to make things better.
Though it's not completely fixed with this workaround, as I can notice a leak at a rate of ~0.1MB/10min (compared to the 0.1MB/10sec before...).

Revision history for this message
Ivan Zakharyaschev (imz) wrote :

Comments 49, 50, and 51 show that the bug is still there in 12.04 (even after the fix was said to be released).

Hence, veriication failed.

Should be reopened? (I can't change the status of the bug...)

tags: added: verification-failed
removed: verification-needed
Revision history for this message
GouZi (jalliot) wrote :

Reading the comments twice, the original issue was indicator-multiload causing a leak in compiz and it seems fixed. At least no one did complain about it recently and I don't see indicator-multiload causing some leak in compiz (feel free to speak up if you see something though).

However what most people see is a leak in the indicator-multiload process itself (comments 46 to 54), maybe this should be investigated as part of bug 1049282 instead:
https://bugs.launchpad.net/ubuntu/+source/indicator-multiload/+bug/1049282

Revision history for this message
Chris Lott (chrislott) wrote :

This is a me-too. Running Ubuntu 12.04 64bit with unity. The indicator outed itself :) I noticed high memory use from its little icon on the top bar, so I checked top and saw the indicator-multiload process had 1.8Gb resident. The compiz process was using hundreds of meg, maybe excessive but nothing like the indicator.

I don't see any mention of whether a fix will arrive with 12.10. How do these bugs get reopened? Would someone please explain? Thanks.

Revision history for this message
Ilya Schurov (ily2) wrote :

Chris, it seems that correct bug report for our current problems is bug 1049282 (https://bugs.launchpad.net/ubuntu/+source/indicator-multiload/+bug/1049282), you can subsribe there.

Revision history for this message
h1bymask (h1bymask) wrote :

BTW bug #1049282 (System load indicator leaks memory, https://bugs.launchpad.net/bugs/1049282) was marked as a duplicate of 905854 (memory leak in unity-2d-panel and indicator-multiload, https://bugs.launchpad.net/bugs/905854) which seems to contain more info.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

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

Changed in unity (Ubuntu Natty):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

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