xfce4-volumed using too much RAM

Bug #607474 reported by Kangarooo Jānis on 2010-07-19
42
This bug affects 10 people
Affects Status Importance Assigned to Milestone
xfce4-volumed
Critical
Steve Dodier-Lazaro
keybinder (Ubuntu)
Undecided
Unassigned
xfce4-volumed (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: xfce4-volumed

Using too much ram see pic after 5h working and after restart also very much also pic

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: xfce4-volumed 0.1.8-1ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-9.14-generic 2.6.35-rc5
Uname: Linux 2.6.35-9-generic i686
Architecture: i386
Date: Tue Jul 20 00:39:57 2010
EcryptfsInUse: Yes
InstallationMedia: Xubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100701)
ProcEnviron:
 LANG=lv_LV.utf8
 SHELL=/bin/bash
SourcePackage: xfce4-volumed
---
Architecture: i386
DistroRelease: Ubuntu 10.10
EcryptfsInUse: Yes
InstallationMedia: Xubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100701)
Package: xfce4-mixer 1:4.6.1-2ubuntu2
PackageArchitecture: i386
ProcEnviron:
 LANG=lv_LV.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.35-9.14-generic 2.6.35-rc5
Tags: maverick
Uname: Linux 2.6.35-9-generic i686
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Kangarooo Jānis (kangarooo) wrote :
tags: added: apport-collected
description: updated

apport information

Kangarooo Jānis (kangarooo) wrote :

Heres ram size

Charlie Kravetz (charlie-tca) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 417778, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Please continue to report any other bugs you may find.

Changed in xfce4-volumed (Ubuntu):
status: New → Confirmed
Charlie Kravetz (charlie-tca) wrote :

This bug is no longer a duplicate of bug 417778. That bug concerns xfce4-volumed taking 100% of the CPU. This bug was filed because it is using too much ram. This bug can be confirmed by checking the image attached.

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!

Changed in xfce4-volumed (Ubuntu):
importance: Undecided → Medium
summary: - Using too much RAM
+ xfce4-volumed using too much RAM
tags: added: xubuntu
Steve Dodier-Lazaro (sidi) wrote :

Please do not get confused between virtual memory and write memory. On your system, xfce4-volumed appears to be using 600kiB of RAM, and then 6MiB. This still indicates a memory leak, however, but I'm not sure the code I wrote is responsible for it (since it was audited for memory leaks and none were found except for some oneshot code run at initialization).

I have some code to commit for xfce4-volumed that might remove some of the memory leaks (and might add some) since it will change the library used for key bindings. I'm not going to investigate the memory leaks till then.

Changed in xfce4-volumed:
assignee: nobody → Steve Dodier (sidi)
importance: Undecided → Low
status: New → Confirmed
Kangarooo Jānis (kangarooo) wrote :

Here 2 different comps screenshots both Xubuntu 10.10 alpha2 with latest updates

Kangarooo Jānis (kangarooo) wrote :

This also affects oneiric:

VmPeak: 574128 kB
VmSize: 573104 kB
VmLck: 0 kB
VmHWM: 9024 kB
VmRSS: 8248 kB
VmData: 86152 kB
VmStk: 136 kB
VmExe: 24 kB
VmLib: 23512 kB
VmPTE: 140 kB
VmSwap: 0 kB

574MB is a bit much for a daemon that simply adjusts the volume.

Uptime of 21 days.

$ ps uax | grep xfce4-volumed
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
bo 1667 0.0 5.5 1209524 456488 ? Ssl Jun30 5:01 xfce4-volumed

..so 445 MiB.

Indeed. and still leaking/consuming an inordinate amount of memory for what it does:

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 4889 brian 20 0 570m 4512 2716 S 0 0.1 0:14.73 xfce4-volumed

Yes, the RES is quite small compared to the VIRT, but really why does such a utility need almost 600MB of memory, virtual or otherwise?

Hrm. I don't see the launchpad function to link to other bug trackers any more.

In any case, I have filed this bug upstream at https://bugzilla.xfce.org/show_bug.cgi?id=9144

yurx cherio (cherio) wrote :

Still happening in 12.04 64bit. 312M is "a bit excessive" for volume management.

Filipe Boleto (fboleto) wrote :

Linux Mint 14 xfce edition with the same issue

$ ps uax | grep xfce4-volumed
uskto 2442 0.0 3.3 2039656 268096 ? Tsl Jun26 6:25 xfce4-volumed

Any suggestion workaround?

thank you

micsu (micsu-z) wrote :

same here :(
fresh install of Xubuntu 12.04.3 + updates
up time 27 hrs
RSS=8MiB
VSZ=262MiB

thanks, robert

Steve Dodier-Lazaro (sidi) wrote :

As I've written a few years back, the code in xfce4-volumed itself does not leak (much). I'm pretty convinced that leaks occur within gstreamer for certain types of configurations / cards, rather than within xvd itself (though I will correct my code if proven wrong :) ).

People posting 'ps aux' commands will not help me to figure out what triggers the leaks, since that does not tell me what card they have, and how their gstreamer is configured.

Please also note that xvd is no longer officially supported, and some distros ship a modified version with a PulseAudio backend. I'd need at the very least to know which backend is being used and what hardware/software is being used, so I can forward bugs to gstreamer if appropriate.

Julian Gilbey (jdg) wrote :

How do I determine which backend is being used? I am also suffering from the same problem.

First of all, type 'ps aux | grep pulseaudio' to verify whether you use
Pulseaudio or GStreamer. If you use Pulseaudio and used GStreamer before,
it's probably good to clear your config, remove xfce4-volumed and install
xfce4-volumed-pulse instead (courtesy of Lionel Le Folgoc). Be careful that
xvd picks up the first sound card it finds when it runs, so if xvd ends up
controlling the sound of your TV, kettle, cat, or something else than your
"primary" speakers, then you'll have to go into the xfconf settings of xvd
(using xfce4-settings-editor for instance) and modify the settings to use
another card.

Which brings us to checking your audio cards:
http://www.linuxnix.com/2013/06/find-sound-card-details-in-linuxunix.htmlwill
give you some commands to identify your sound card, then you can try
to google it and see if it's one of those cards that are known to be
misfunctioning on default installs of GStreamer on your distro (happened a
lot back in the day when I wrote xvd). Generally speaking if you're using
GStreamer then it's a good idea to find out what card you have, and go
through GStreamer's bugzilla in search for information on potential memory
leaks or issues.

As a gentle reminder, xfce4-volumed is no longer supported. It might be
time to switch to Pulseaudio and use xfce4-volumed-pulse instead :)

2014-04-30 10:47 GMT+01:00 Julian Gilbey <email address hidden>:

> How do I determine which backend is being used? I am also suffering
> from the same problem.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

Thanks for the pointers! I've got pulseaudio running, and the sound card (it's a MacBook Pro running Debian) is:
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
Debian doesn't currently have xfce4-volumed-pulse; I'll try the Ubuntu package.

Steve Dodier-Lazaro (sidi) wrote :

Julian, thanks for the report! Could I please ask you to check if this
happen when:

- using Alsa as a backend and vanilla xfce4-volumed
- using PA as a backend and vanilla xfce4-volumed
- using PA as a backend and xfce4-volumed-pulse

Understanding when the leak occurs will help us to identify which code
section is causing the leak, and then we know who to talk to to find the
cause.

2014-05-01 13:41 GMT+01:00 Julian Gilbey <email address hidden>:

> Thanks for the pointers! I've got pulseaudio running, and the sound card
> (it's a MacBook Pro running Debian) is:
> 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset
> Family High Definition Audio Controller (rev 04)
> Debian doesn't currently have xfce4-volumed-pulse; I'll try the Ubuntu
> package.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

Hmm, I still don't know how to figure out which backend is being used. I've used xfce4-settings-editor, and the list of channels includes:
displays, keyboard-layout, keyboards, thunar, thunar-volman, xfce4-{desktop,keyboard-shortcuts,mixer,panel,power-manager,session,settings-editor,settings-manager}, xfwm4, xsettings
On my Debian system, I can't find anything approximating xvd.
I'm not clear how I select the backend for xfce4-volumed{,-pulse} :(

I do know that I have pulseaudio running with xfce4-volumed on my vanilla xfce4-volumed:
redfield:~ $ ps aux | grep pulse
jdg 9925 0.0 0.0 10708 872 pts/2 S+ 14:14 0:00 grep pulse
jdg 24918 0.0 0.0 377880 3964 ? S<l Apr30 0:00 /usr/bin/pulseaudio --start --log-target=syslog

But that may not necessarily mean that it's the direct backend: xfce4-volumed is linked to libgstreamer, which has a pulseaudio backend, so it may be that connection which is leaking memory, perhaps?

Anyway, I'm going to uninstall xfce4-volumed and replace it with xfce4-volumed-pulse, and leave that running for a few days. I won't be back in my office until next Tuesday, so I won't be able to give the results of this experiment until then.

Thanks!

Julian

Steve Dodier-Lazaro (sidi) wrote :

Hi Julian,

Sorry I wasn't really clear! xfce4-volumed (vanilla) only knows GStreamer, so it tries to find an audio card and then interacts with it. What PulseAudio does (as far as I know) to make old apps like xfce4-volumed work is that it emulates an Alsa card, which xfce4-volumed picks up if configured properly (in short if you install PulseAudio after using Alsa you may need to manually change the xfconf keys of xfce4-volumed to start using the Pulse "card").

The reason I wanted multiple tests done is because I don't know where the leak is. I've looked at my code a lot and it should only leak a little bit when it's disconnecting. So the leak might be in the GStreamer mixer interface with some configurations, the keybinder library with some configurations (not so likely), etc. I can't trigger leaks on my system, but trying Pulse or Alsa as a backend might give clues on what code branches or what parameters cause some function to leak. Trying the -pulse version will also inform whether it's some of the code only present in vanilla that leaks (in which case it's more likely to be my fault :) ).

To try using Alsa instead of Pulse, the most direct way is to remove Pulse from your system and kill the pulseaudio daemon (make sure to save whatever custom configuration you have). To try -pulse, you'd need to get the package from Ubuntu, I don't remember the name of the PPA/repository where it is though.

Your help is very appreciated, and obviously take your time, this bug has been here for 5 years anyway, so there's no hurry ;)

Julian Gilbey (jdg) wrote :

Hi Steve,

Thanks for the explanation.

I've just come back in, opened my computer and waited and waited and waited for it to respond ;-)
With xfce4-volumed-pulse, things are as bad as before: with top sorted by %MEM:

top - 10:36:36 up 8 days, 34 min, 5 users, load average: 16.32, 19.37, 15.93
Tasks: 249 total, 1 running, 248 sleeping, 0 stopped, 0 zombie
%Cpu(s): 5.7 us, 1.4 sy, 0.0 ni, 24.5 id, 68.4 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3964008 total, 3874228 used, 89780 free, 3040 buffers
KiB Swap: 9760764 total, 8485812 used, 1274952 free. 150392 cached Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10701 jdg 20 0 8702408 1.234g 1164 D 0.0 32.7 73:15.19 xfce4-volu+
10608 jdg 20 0 2560556 1.144g 12604 S 0.3 30.3 32:22.79 xfsettingsd
11137 jdg 20 0 1454064 345380 9332 D 0.3 8.7 21:02.01 iceweasel

Then ps aux shows:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
jdg 10701 1.0 32.3 8701956 1281372 ? Dsl May01 73:13 xfce4-volumed-pulse
jdg 24918 0.0 0.0 377880 792 ? S<l Apr30 0:00 /usr/bin/pulseaudio --start --log-target=syslog

But top sorted by %CPU shows very little of interest:

top - 10:36:48 up 8 days, 34 min, 5 users, load average: 14.91, 18.91, 15.83
Tasks: 248 total, 1 running, 247 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.9 us, 1.0 sy, 0.0 ni, 41.5 id, 54.6 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3964008 total, 3836104 used, 127904 free, 1748 buffers
KiB Swap: 9760764 total, 8489832 used, 1270932 free. 139944 cached Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
30731 root 20 0 76676 1880 840 S 6.6 0.0 399:25.52 cups-brows+
10401 root 20 0 278536 19896 5396 S 3.7 0.5 372:56.88 Xorg
18022 root 20 0 85228 3072 904 S 3.0 0.1 91:17.50 cupsd
11059 jdg 20 0 582780 9336 4248 S 1.3 0.2 0:59.45 xfce4-term+
10608 jdg 20 0 2560556 1.142g 12604 D 0.7 30.2 32:22.83 xfsettingsd
   39 root 20 0 0 0 0 D 0.3 0.0 12:04.63 kswapd0
 5204 postgres 20 0 221736 1168 804 S 0.3 0.0 4:08.56 postgres
 5703 root 20 0 4208 128 108 S 0.3 0.0 0:00.29 minissdpd
10607 jdg 20 0 535372 8720 4216 S 0.3 0.2 0:38.58 xfce4-panel
10655 jdg 20 0 181124 3416 2416 S 0.3 0.1 10:50.06 panel-15-c+

Interestingly, xfsettingsd was also gobbling memory; I don't know whether that's part of the same bug, with one causing the other, or whether it's an unrelated bug.

Next step: back to xfce4-volumed and remove pulseaudio.

   Julian

Steve Dodier-Lazaro (sidi) wrote :
Download full text (3.5 KiB)

Very interesting!

Julian, may I also ask you to attach the output of #cat /proc/<pid of
xfce4-volumed>/maps and #cat /proc/<pid of xfsettings>/maps ? It will tell
the whole list of libraries that are opened by each app.

2014-05-06 10:56 GMT+01:00 Julian Gilbey <email address hidden>:

> Hi Steve,
>
> Thanks for the explanation.
>
> I've just come back in, opened my computer and waited and waited and
> waited for it to respond ;-)
> With xfce4-volumed-pulse, things are as bad as before: with top sorted by
> %MEM:
>
> top - 10:36:36 up 8 days, 34 min, 5 users, load average: 16.32, 19.37,
> 15.93
> Tasks: 249 total, 1 running, 248 sleeping, 0 stopped, 0 zombie
> %Cpu(s): 5.7 us, 1.4 sy, 0.0 ni, 24.5 id, 68.4 wa, 0.0 hi, 0.0 si,
> 0.0 st
> KiB Mem: 3964008 total, 3874228 used, 89780 free, 3040 buffers
> KiB Swap: 9760764 total, 8485812 used, 1274952 free. 150392 cached Mem
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 10701 jdg 20 0 8702408 1.234g 1164 D 0.0 32.7 73:15.19
> xfce4-volu+
> 10608 jdg 20 0 2560556 1.144g 12604 S 0.3 30.3 32:22.79
> xfsettingsd
> 11137 jdg 20 0 1454064 345380 9332 D 0.3 8.7 21:02.01
> iceweasel
>
>
> Then ps aux shows:
>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> jdg 10701 1.0 32.3 8701956 1281372 ? Dsl May01 73:13
> xfce4-volumed-pulse
> jdg 24918 0.0 0.0 377880 792 ? S<l Apr30 0:00
> /usr/bin/pulseaudio --start --log-target=syslog
>
> But top sorted by %CPU shows very little of interest:
>
> top - 10:36:48 up 8 days, 34 min, 5 users, load average: 14.91, 18.91,
> 15.83
> Tasks: 248 total, 1 running, 247 sleeping, 0 stopped, 0 zombie
> %Cpu(s): 2.9 us, 1.0 sy, 0.0 ni, 41.5 id, 54.6 wa, 0.0 hi, 0.0 si,
> 0.0 st
> KiB Mem: 3964008 total, 3836104 used, 127904 free, 1748 buffers
> KiB Swap: 9760764 total, 8489832 used, 1270932 free. 139944 cached Mem
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 30731 root 20 0 76676 1880 840 S 6.6 0.0 399:25.52
> cups-brows+
> 10401 root 20 0 278536 19896 5396 S 3.7 0.5 372:56.88 Xorg
> 18022 root 20 0 85228 3072 904 S 3.0 0.1 91:17.50 cupsd
> 11059 jdg 20 0 582780 9336 4248 S 1.3 0.2 0:59.45
> xfce4-term+
> 10608 jdg 20 0 2560556 1.142g 12604 D 0.7 30.2 32:22.83
> xfsettingsd
> 39 root 20 0 0 0 0 D 0.3 0.0 12:04.63 kswapd0
> 5204 postgres 20 0 221736 1168 804 S 0.3 0.0 4:08.56
> postgres
> 5703 root 20 0 4208 128 108 S 0.3 0.0 0:00.29
> minissdpd
> 10607 jdg 20 0 535372 8720 4216 S 0.3 0.2 0:38.58
> xfce4-panel
> 10655 jdg 20 0 181124 3416 2416 S 0.3 0.1 10:50.06
> panel-15-c+
>
> Interestingly, xfsettingsd was also gobbling memory; I don't know
> whether that's part of the same bug, with one causing the other, or
> whether it's an unrelated bug.
>
> Next step: back to xfce4-volumed and remove pulseaudio.
>
> Julian
>
> --
> You received this bug notification because you are a bu...

Read more...

Julian Gilbey (jdg) wrote :

Oops, I'd already removed the packages and logged in again. Have now reinstalled pulseaudio and xfce4-volumed-pulse, logged in again, and attach the resulting maps dumps. Shall I continue with the vanilla xfce4-volumed without pulseaudio test?

Thanks!

Julian Gilbey (jdg) wrote :

Ah, could only include one attachment. Here's the xfsettingsd one.

Julian Gilbey (jdg) wrote :

(Oh, and if anyone else is looking for the xfce4-volumed-pulse package, the PPA is at https://launchpad.net/~mrpouit/+archive/ppa)

Steve Dodier-Lazaro (sidi) wrote :

Sure Julian, the more data you can provide me the likelier I will spot
what's going on (well, hopefully :-) ).

2014-05-06 13:01 GMT+01:00 Julian Gilbey <email address hidden>:

> (Oh, and if anyone else is looking for the xfce4-volumed-pulse package,
> the PPA is at https://launchpad.net/~mrpouit/+archive/ppa)
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

I've tried running without pulseaudio installed, and with the vanilla xfce4-volumed (Debian testing version - 0.1.13-3). The results are similarly gloomy: top by %MEM and by %CPU:

top - 10:06:08 up 10 days, 3 min, 7 users, load average: 0.69, 0.71, 0.74
Tasks: 240 total, 1 running, 239 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.2 us, 0.2 sy, 0.0 ni, 97.3 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3964008 total, 3819500 used, 144508 free, 2964 buffers
KiB Swap: 9760764 total, 4109228 used, 5651536 free. 117516 cached Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27169 jdg 20 0 6027996 2.389g 1232 S 0.0 63.2 46:59.97 xfce4-volu+
27063 jdg 20 0 1012692 429232 1288 S 0.0 10.8 7:56.93 xfsettingsd
27121 jdg 20 0 918084 274812 1996 S 0.0 6.9 3:43.79 panel-14-m+
27661 jdg 20 0 1203644 207228 3716 S 0.7 5.2 7:47.82 iceweasel

top - 10:06:34 up 10 days, 4 min, 7 users, load average: 0.69, 0.71, 0.74
Tasks: 240 total, 2 running, 238 sleeping, 0 stopped, 0 zombie
%Cpu(s): 11.2 us, 3.5 sy, 0.0 ni, 85.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3964008 total, 3816620 used, 147388 free, 2520 buffers
KiB Swap: 9760764 total, 4108836 used, 5651928 free. 114220 cached Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
26657 root 20 0 194076 9108 2376 R 40.2 0.2 177:26.33 Xorg
27169 jdg 20 0 6030696 2.392g 1232 S 5.0 63.3 47:01.25 xfce4-volu+
27584 root 20 0 76764 1884 808 S 4.0 0.0 130:53.71 cups-brows+
27063 jdg 20 0 1013016 429556 1288 S 2.7 10.8 7:57.20 xfsettingsd
 2900 root 20 0 84784 2736 832 S 1.3 0.1 3:12.57 cupsd

ps aux output:
jdg 27169 5.4 63.3 6034584 2511704 ? Ssl May07 47:03 xfce4-volumed
jdg 27063 0.9 10.8 1013556 430096 ? Ssl May07 7:57 xfsettingsd --display :0.0 --sm-client-id 23a62111e-b5f0-46de-8710-5dd39d2341eb

Attached is a tarball containing the /proc/PID/maps output for these two processes, along with the output of hwinfo.

Also interesting is that although I'm seeing this problem on this MacBook Pro, I don't have the same issue with my PC desktop at home, so there is certainly some hardware issue connected to this.

Thanks from a bewildered Julian!

Steve Dodier-Lazaro (sidi) wrote :

I had a chat with the GStreamer people, and GstMixer will not be replaced in future releases in GStreamer. They also no longer take fixes for GStreamer 0.10. That means that anyway I'll rewrite the daemon to use libpulse and libasound directly.

Julian, after this chat I also think that the memory leak you have is related to libasound and libpulse. Running valgrind again, my code seems to leak only stuff from init functions, that get called once (it's because they're not released when I interrupt the daemon, actually).

Can *all* users with a memory leak please do the following:
- Download and extract the source
- Go to the source directory and type: ./configure --enable-debug
- Then type: make
- Then run: valgrind --leak-check=full ./src/xfce4-volumed >REPORT 2>&1
- Enjoy your computer for about 30 minutes
- After a while, go back to the terminal, hit Ctrl+C to stop valgrind
- Send me the report so I can count the libasound and libpulse related leaks and report to those people
- Also remember to tell me precisely what your computer is -- if you know, tell what audio hardware you have

I'm sorry but it'll take a bit of time for me to push a patch. I have a few high-priority pieces of code to release now before I can hack again on xvd...

Changed in xfce4-volumed:
status: Confirmed → Triaged
importance: Low → Critical
Julian Gilbey (jdg) wrote :

I installed the debugging libraries, and here is some valgrind output. Enjoy!

Thanks,

Julian

Steve Dodier-Lazaro (sidi) wrote :

Turns out I had forgotten some leaks. You can try this patch if you want, though you shouldn't have many hopes! It seems XkbGetMap is the culprit for you and I've no idea what even causes this to be called.

Julian Gilbey (jdg) wrote :

I've applied the patch; here's the new output of valgrind.

Thanks!

Steve Dodier-Lazaro (sidi) wrote :

So it does leak just as much for you! If you're ok with it I'll write a
couple of other patches disabling notifications, keybinding, volume
control... I'm very surprised that it's not just libasound leaking! Thanks
again for all this help.

2014-05-09 13:57 GMT+01:00 Julian Gilbey <email address hidden>:

> I've applied the patch; here's the new output of valgrind.
>
> Thanks!
>
> ** Attachment added: "xfce4-patched-REPORT.txt"
>
> https://bugs.launchpad.net/ubuntu/+source/xfce4-volumed/+bug/607474/+attachment/4108685/+files/xfce4-patched-REPORT.txt
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

I'd be more than happy to help you debug it! Send me patches (either via this bug report or to my email directly) and I'll try them out.

Have a good weekend!

Julian

Steve Dodier-Lazaro (sidi) wrote :

This patch removes all mixer branches -- obviously it'll strip down your xvd to a piece of useless junk! Let me know if it still leaks a lot. Apply separately from the previous and next patches.

Steve Dodier-Lazaro (sidi) wrote :

This patch removes all xfconf branches -- volume notifications should work but only the mute key should be properly handled. Let me know if it still leaks a lot. Apply separately from the previous and next patches.

Steve Dodier-Lazaro (sidi) wrote :

This patch removes keybinder code -- only volume change notifications will work. Let me know if it still leaks a lot. Apply separately from the previous and next patches.

Note that there's a possibility simply including the libraries causes leakages (because libraries sometimes do dirty stuff...), so if you're still leaking with either of the patches then I'll make more aggressive ones that remove libraries entirely.

Julian Gilbey (jdg) wrote :

Thanks for those patches. Attached is a tarball with three valgrind reports, one corresponding to each patch.

Good luck - I hope they help make sense of what's going on!

Julian

Steve Dodier-Lazaro (sidi) wrote :

The culprit is keybinder. I'm fairly convinced it's unmaintained, but I could maybe fix it myself.

I would need you to find out how to install a debug version of it and re-run valgrind on any xfce4-volumed (-pulse or vanilla). Then I can see which function it is that causes these huge leaks. For instance on the trace below, there are three functions leading to XkbGetMap and malloc, but in my key event handler I don't have any freeable objects so it must be one of those three functions (marked ??? because you have the normal library rather than the debug library) that forgets to free something... and somehow only on certain platforms:

==26234== 164,683,872 bytes in 2,287,276 blocks are definitely lost in loss record 3,817 of 3,817
==26234== at 0x4C29590: calloc (vg_replace_malloc.c:618)
==26234== by 0xA6499C0: XkbGetMap (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==26234== by 0x6B0172E: ??? (in /usr/lib/libkeybinder.so.0.1.0)
==26234== by 0x6B017FD: ??? (in /usr/lib/libkeybinder.so.0.1.0)
==26234== by 0x6B0190F: ??? (in /usr/lib/libkeybinder.so.0.1.0)
==26234== by 0x57CA5E6: _g_closure_invoke_va (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4000.0)
==26234== by 0x57E3087: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4000.0)
==26234== by 0x57E4211: g_signal_emit_by_name (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4000.0)
==26234== by 0x7397C9F: ??? (in /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0.2400.23)
==26234== by 0x7398125: ??? (in /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0.2400.23)
==26234== by 0x73981CD: ??? (in /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0.2400.23)
==26234== by 0x4E7AE03: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)

Let me know if you need instructions, and I'll look it up (am not on Ubuntu though).

Steve Dodier-Lazaro (sidi) wrote :

Also I'm not sure if you're a developer yourself or not, so if anything is unclear or cryptic please do tell me and I'll explain better :)

Julian Gilbey (jdg) wrote :

Annoyingly, the Debian keybinder package doesn't offer a -dbg version, so I'll have to compile one. I doubt I'll have time tomorrow, but I'll have a go on Wednesday, all being well. I'll see if I can figure out how to do so (it shouldn't be too hard, right?! famous last words...). And you're right - the original keybinder does seem to be unmaintained - the original site now says 404.

Steve Dodier-Lazaro (sidi) wrote :

Shouldn't be... I need an alternative for keybinder too... It's gonna be so
fun to rewrite this daemon! :D

2014-05-12 23:42 GMT+01:00 Julian Gilbey <email address hidden>:

> Annoyingly, the Debian keybinder package doesn't offer a -dbg version,
> so I'll have to compile one. I doubt I'll have time tomorrow, but I'll
> have a go on Wednesday, all being well. I'll see if I can figure out
> how to do so (it shouldn't be too hard, right?! famous last words...).
> And you're right - the original keybinder does seem to be unmaintained -
> the original site now says 404.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

OK, here's the valgrind output - vanilla xfce4-volumed with keybinder debugging on. I see what you mean about the huge space leaks!

Julian

Steve Dodier-Lazaro (sidi) wrote :

Hi Julian,

Do you use multiple keymaps (e.g. switching keyboard layouts) throughout
the day? Do you have a particular kind of keyboard, or plug a USB keyboard
to your MacBook?

Thanks!

2014-05-14 14:38 GMT+01:00 Julian Gilbey <email address hidden>:

> OK, here's the valgrind output - vanilla xfce4-volumed with keybinder
> debugging on. I see what you mean about the huge space leaks!
>
> Julian
>
> ** Attachment added: "xfce4-keybinder-tracing-REPORT.txt"
>
> https://bugs.launchpad.net/ubuntu/+source/xfce4-volumed/+bug/607474/+attachment/4112359/+files/xfce4-keybinder-tracing-REPORT.txt
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

I have a USB keyboard plugged into the MacBook, and I have three keymaps set up. I don't tend to intentionally change them during the course of the day, but I do occasionally do so inadvertently. If you want to know the details of the USB keyboard, comment #30 above includes the output of hwinfo. It sounds like you think this might well be the trigger for the bug.

A good catch!

   Julian

Steve Dodier-Lazaro (sidi) wrote :

This is indeed quite surprising! If you disable your keymaps and just use
one of them, does it still significantly leak / does xfsettingsd still
leak, too? The trace clearly indicates that the leak occurs precisely when
the keymap is changed -- libkeybinder probably forgets to clean up the data
it had about the previous keymap!

2014-05-14 17:47 GMT+01:00 Julian Gilbey <email address hidden>:

> I have a USB keyboard plugged into the MacBook, and I have three keymaps
> set up. I don't tend to intentionally change them during the course of
> the day, but I do occasionally do so inadvertently. If you want to know
> the details of the USB keyboard, comment #30 above includes the output
> of hwinfo. It sounds like you think this might well be the trigger for
> the bug.
>
> A good catch!
>
> Julian
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

Sorry for slow reply. Anyway, I've disabled all but one keymap (gb altgr-intl), and ran xfce4-volumed again (after logging out and logging in again). I then removed the USB keyboard and did the same. There is still significant memory loss - logs attached.

:-(

Steve Dodier-Lazaro (sidi) wrote :

Well, I know nothing about keymaps implementations but somehow libkeybinder
believes your keymap still changes regularly!

In any case, I don't know how I could fix their own bug, so I'll rewrite
xvd with something else... when I can...

2014-05-28 14:11 GMT+01:00 Julian Gilbey <email address hidden>:

> Sorry for slow reply. Anyway, I've disabled all but one keymap (gb
> altgr-intl), and ran xfce4-volumed again (after logging out and logging
> in again). I then removed the USB keyboard and did the same. There is
> still significant memory loss - logs attached.
>
> :-(
>
> ** Attachment added: "xfce4-one-keyboard.tar.gz"
>
> https://bugs.launchpad.net/ubuntu/+source/xfce4-volumed/+bug/607474/+attachment/4121448/+files/xfce4-one-keyboard.tar.gz
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Julian Gilbey (jdg) wrote :

Great, thanks! I'm glad that the source of the memory leak has at last been identified, even if it will take a while to solve.

:-)

Steve Dodier-Lazaro (sidi) wrote :

Thanks for helping me Julian!

2014-05-29 15:04 GMT+01:00 Julian Gilbey <email address hidden>:

> Great, thanks! I'm glad that the source of the memory leak has at last
> been identified, even if it will take a while to solve.
>
> :-)
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/607474
>
> Title:
> xfce4-volumed using too much RAM
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/xfce4-volumed/+bug/607474/+subscriptions
>

--
Steve Dodier-Lazaro
PhD Student in Information Security
University College London
Free Software Developer
OpenPGP : 1B6B1670

Launchpad Janitor (janitor) wrote :

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

Changed in keybinder (Ubuntu):
status: New → Confirmed
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

Remote bug watches

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