dunst leaks memory

Bug #1330480 reported by Aleksi Häkli
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
dunst (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

dunst seems to be leaking memory. On a couple of days uptime I managed to get it to eat around 7GB in short order. This has been fixed a couple of weeks ago in upstream version but the package doesn't seem to be updated yet. The Github link:

https://github.com/knopwob/dunst/issues/172

Seems like a quick update on repackaging would fix this problem :)

Tags: patch
Revision history for this message
Guillermo (guillermo-cientifico) wrote :

After login, with all the connected network and notifications, it already consumes 50% of all the memory.
So after 5-10 songs in spotify, the machine is almost dead.

Revision history for this message
Martin Olsson (mnemo) wrote :

I also thought it was issue #172 at first but applying that patch didn't help much for me. What did help was this one:
https://github.com/knopwob/dunst/issues/173

...before I applied that patch "dunst" RSS increased permanently with about 70MB every time I switched songs in Spotify for Linux. Running notify-send lots of times in a script didn't trigger the bug, it's only certain notifications that trigger the leak and Spotify seems to be sending these particular notifications.

I noticed this because my dayjob compilation started to freeze my machine (despite having 18GB RAM). This monday when I got to work my machine was really slow and kswap0 was taking 100% in kernel threads. Turns out "dunst" had 41GB mapped and 16GB RSS at that point because I had accidentally left spotify running over the weekend.

Adding the g_variant_unref(content); call that catharsis suggests in the upstream bug worked well for me and dunst no longer leaks. I'm attaching a copy of this patch here as well.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in dunst (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Olsson (mnemo) wrote :

If someone wants to try this patch to see if it fixes your issue, you need to do roughly this:

mkdir ~/src/dunst_apt ; cd ~/src/dunst_apt
sudo apt-get source dunst
cd dunst-1.0.0/
sudo apt-get build-dep dunst
# apply the patch, i.e. insert the call to g_variant_unref(content) at the right place in dbus.c
dpkg-source --commit
# enter some temp name for the patch like "fix-spotify-leak" or so
debuild -us -uc
cd ..
sudo dpkg -i dunst_1.0.0-2_amd64.deb

....or if you think that sounds too complicated, just download and "dpkg -i" the following pre-built .deb (suitable for 14.04 x64):
http://temp.minimum.se/dunst_1.0.0-2_amd64.deb

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
TANGUY Arnaud (geenux) wrote :

The patch in #4 seems to solve the issue indeed. Thanks!

After 5 hours of playing, dunst uses 376M of memory, which doesn't seem too unreasonable (at least compared to the 6G it would previously be using!).
It doesn't seem to increase after prolonged use.

Revision history for this message
Chris Pick (cpick) wrote :

I've applied the patch and uploaded the result to ppa:cpick/dunst.

trusty users should be able to install it with:
$ sudo add-apt-repository ppa:cpick/dunst
$ sudo apt-get update
$ sudo apt-get upgrade

dunst must then be restarted to pick up the new version (eg with `killall dunst` or similar).

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

Other bug subscribers

Patches

Remote bug watches

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