Bug 233133 - knotify leaks huge amounts of memory
Summary: knotify leaks huge amounts of memory
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-03 06:21 UTC by Thomas Fjellstrom
Modified: 2014-09-19 20:14 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.5.1


Attachments
'knotify4' memory consumption (87.63 KB, application/octet-stream)
2011-05-31 20:06 UTC, Matija Šuklje
Details
valgrind output (557.45 KB, text/x-log)
2013-06-30 18:21 UTC, Hussam Al-Tayeb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Fjellstrom 2010-04-03 06:21:29 UTC
Version:            (using KDE 4.4.2)
Compiler:          gcc 4.4.3 
OS:                Linux
Installed from:    Debian testing/unstable Packages

All I have to do is leave my laptop running for a while and knotify4 will consume hundreds of megabytes of ram, eventually GBs if I let it. Normally I just kill it before it becomes to big of a problem.

If it helps I have the phonon backend set to xine. I heard a rumor ages ago that this was due to the xine backend not letting go of oggs, but I have no proof of that (it didn't seem to leak when set to the gstreamer backend, but these days I can't seem to get that backend to play any sound, so meh).

to verify, heres the ps output:

moose    22910  1.0  5.7 1750280 232012 ?      Sl   Apr01  17:01 /usr/bin/knotify4

(and no this is not an april fools prank)
Comment 1 Andrew Brouwers 2010-11-08 15:41:22 UTC
I can confirm that this is still present on kde 4.5.x.  I am also using the xine backend; after starting KDE, knotify starts at around 18mb of ram usage.  After a few hours time, checking ps (or kde system monitor) shows knotify increasing its ram consumption to almost 100mb.
Comment 2 Matija Šuklje 2011-05-31 20:02:31 UTC
I can confirm this on Gentoo, KDE 4.6.2.

For me 'knotify4' currently eats up 1.8 GiB of RAM.

I think this happens (at least) when network goes down and I get tons of notifications from KMail/Akonadi about the IMAP folders not being available.
Comment 3 Matija Šuklje 2011-05-31 20:06:57 UTC
Created attachment 60524 [details]
'knotify4' memory consumption

Detailed memory consumption for 'knotify4' process as provided by Ksysguard.
Comment 4 Patrick ALLAERT 2011-06-01 11:48:06 UTC
Confirmed here too with Gentoo, KDE 4.6.2
Comment 5 Patrick ALLAERT 2011-06-01 11:50:39 UTC
*** This bug has been confirmed by popular vote. ***
Comment 6 Unnamed_Hero 2011-06-06 18:25:58 UTC
I can reproduce this bug with this:
1. Make sure sound notification is on
2. Make sure phonon backend is gstreamer
3. Launch konsole with htop/top to monitor
4. Create invalid launcher icon, for example for /usr/bin/file_that_not_exists.exe
5. Launch  any player, play any audio/video (tested with deadbeef and vlc)
6. Launch just created invalid launcher icon. Error message will appear, than knotify4 process will eat ~90% cpu and slowly leak.
Comment 7 Johan Thelmen 2011-06-22 00:05:02 UTC
Me too, over 3GiB in swap per process with multiple users on the same HW it is a real killer. I would say severity is Critical since it is a severe memory leak in just some hours.
Comment 8 Daniele 2011-06-27 18:47:28 UTC
I confirm too, Gentoo 64bit and KDE 4.6.3. Occasionally knotify uses about 90% of the cpu and eats all the available memory until i kill it.
Comment 9 Diego 2011-07-06 19:36:43 UTC
Here too: Arch Linux with KDE 4.6.3.
Comment 10 Christoph Feck 2011-09-15 17:18:02 UTC
Is this bug only happening with the Phonon gstreamer backend?
Comment 11 Matt Whitlock 2011-09-15 18:45:21 UTC
For what it's worth, I've had a knotify4 running for a little over a day, it's consumed 38 minutes worth of CPU time (which seems outrageous, btw), yet its private bytes are still a cool 12.5 MiB and pixmap memory is 124 KiB. I'm running KDE 4.7.1 using the Gstreamer Phonon backend.
Comment 12 Thomas Fjellstrom 2011-09-15 18:55:24 UTC
If it helps at all, I only ever had issues with Gstreamer and Xine backends. Right now my knotify4 is at 4k ram and 28 seconds of cpu time, and kde's been running a while now (around 3 days). If you can try the VLC backend I suggest you do.
Comment 13 Matt Whitlock 2011-09-15 19:05:51 UTC
4K RAM?!  That's impossible.  Are you sure that's not the resident set size (with the majority of the private bytes having been paged to swap)?
Comment 14 Thomas Fjellstrom 2011-09-15 19:41:20 UTC
You're right, my bad. ps_mem says: 1.8 MiB + 304.5 KiB =   2.1 MiB       knotify4

still not bad.
Comment 15 Christoph Feck 2011-10-28 11:30:27 UTC
What is the status of this bug? Does it still happen with a recent KDE version, such as 4.6.5 or 4.7.x, e.g. when trying to reproduce the steps from comment #6? Please add a comment.

Since this is related to Phonon, please check if you are using the latest Phonon version (4.5.x). Also try different backends and backend versions. Note that Xine backend is no longer maintained.

Reassigning to Phonon maintainers for further investigation.
Comment 16 Myriam Schweingruber 2011-10-29 16:33:30 UTC
Setting status correctly. Please all test with the latest Phonon 4.5.1 version as well as with the latest phonon-backend-gstreamer (4.5.1) and phonon-backend-vlc (0.4.1).
Comment 17 Unnamed_Hero 2011-11-18 19:33:16 UTC
KDE 4.7.3, phonon/gstreamer v 4.5.0 
Can't reproduce. I'll try to test with newer version of backends next week.
Comment 18 DrHouse 2011-11-30 20:57:43 UTC
I can reproduce this on Gentoo amd64, KDE 4.6.5 and media-libs/phonon-gstreamer-4.5.0.
It happen when loading ktorrent, skype, kopete and other app at same time while login in system. 
But with media-libs/phonon-gstreamer-4.5.1 it's  unable to reproduce.

Now I using KDE-4.7.3 and I have these backends:

media-libs/phonon-gstreamer-4.5.1
media-libs/phonon-xine-4.4.4
media-libs/phonon-vlc-4.1

And memory leaking, 100% cpu utilization now never were appear.

P.S. Sorry for my English.
Comment 19 Myriam Schweingruber 2011-12-01 16:32:09 UTC
Thank you for the feedback.
Comment 20 Daniele 2011-12-01 16:39:27 UTC
I confirm I've never had this problem with kde 4.7.3 on Gentoo 64bit. Thanks to everyone who worked on this.
Comment 21 Lukas Zavodny 2011-12-02 05:17:03 UTC
Well I let pc running all the night and knotify4 eats 7GB ram and my hdd was crazy :) After killing knotify4, popup from phonon shows, that my card isn't usable and falling back to default

Gentoo 64bit, KDE 4.7.3, phonon-gstreamer 4.5.1

I am not sure, if this is fixed :)
Comment 22 Myriam Schweingruber 2011-12-02 15:28:41 UTC
Very strange. I was never able to reproduce this here BTW, so maybe some particular setup. And this is not aboout the gstreamer backend, but about Phonon itself, do you really have version 4.5.1?
Comment 23 DrHouse 2011-12-03 22:01:53 UTC
(In reply to comment #21)
> Well I let pc running all the night and knotify4 eats 7GB ram and my hdd was
> crazy :) After killing knotify4, popup from phonon shows, that my card isn't
> usable and falling back to default
> 
> Gentoo 64bit, KDE 4.7.3, phonon-gstreamer 4.5.1
> 
> I am not sure, if this is fixed :)

Your emerge --info is needed.
Comment 24 DrHouse 2011-12-03 22:13:10 UTC
(In reply to comment #23)
> (In reply to comment #21)
> > Well I let pc running all the night and knotify4 eats 7GB ram and my hdd was
> > crazy :) After killing knotify4, popup from phonon shows, that my card isn't
> > usable and falling back to default
> > 
> > Gentoo 64bit, KDE 4.7.3, phonon-gstreamer 4.5.1
> > 
> > I am not sure, if this is fixed :)

Your emerge --info is needed. Try to emerge =media-libs/phonon-4.5.1-r1
Comment 25 Hussam Al-Tayeb 2013-06-30 18:21:59 UTC
Created attachment 80871 [details]
valgrind output

valgrind output for knotify4. I noticed it can cross the 300MB memory usage on kde 4.10.4
Comment 26 Harald Sitter 2013-07-01 10:48:20 UTC
inconclusive data.

that valgrind log shows a possible leak of all in all ~0.1mib, (and at least 0.05mib of that are definitely not a leak at all) so I'd say that actually does not show your leak.

also I'd advise to report a new bug since this one was dorment for 2 years I doubt the issues are releated in any way.
Comment 27 Hussam Al-Tayeb 2014-09-19 20:14:44 UTC
This is much better with the phonon gstreamer-1.0 plugin. it peaks at ~38MB and stays there.