Bug 203628 - kio_thumbnail process eats all my memory when MPlayerThumbs uses the Phonon backend to generate movie thumbnails in Dolphin
Summary: kio_thumbnail process eats all my memory when MPlayerThumbs uses the Phonon b...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: thumbnail (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Malte Starostik
URL:
Keywords:
: 219025 221262 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-12 22:57 UTC by Piotr Mitas
Modified: 2018-06-29 21:15 UTC (History)
29 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kio_thumbnail eats over 70% of memory (268.32 KB, image/png)
2009-08-27 19:31 UTC, migo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mitas 2009-08-12 22:57:27 UTC
Version:            (using KDE 4.3.0)
Compiler:          gcc 4.3.4 
OS:                Linux
Installed from:    Gentoo Packages

Today after having my computer run for about a day i looked at gkrellm window, which showed me that a KDE desktop + firefox takes almost 1.5GB of memory. Quick look at top revealed the mystery:
  
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
7751 piotrek   20   0 1718m 909m  15m S    1 45.3   5:07.64 kio_thumbnail

lsof told me the process has 2 open files: one wmv and one mpg, both of which were on a cd I ejected a few hours ago. 

Running strace on the only running thread showed a lot of these:

select(0, NULL, NULL, NULL, {0, 15612}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\4\362?\26\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 448
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0\32\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\4\2@\32\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 448
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0\36\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\4\22@\36\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 448
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0\"\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\4\"@\"\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 448
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0&\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\0042@&\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 448
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0*\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 1 (out [17])
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0.\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 1 (out [17])
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0002\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\4B@*\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 1344
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0006\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\4r@6\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 448
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0:\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 1 (out [17])
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0>\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)
select(18, [17], [17], NULL, NULL)      = 2 (in [17], out [17])
read(17, "\0\4\202@:\20t\4\0\0006\0\0\0\0\0\320c\333\6\0\0\0\0\4\0\0\0\0\0\0\0\0"..., 4096) = 896
writev(17, [{"8\0\4\0\0\0`\4\4\0\0\0\0\0\0\0006\0\2\0B\20t\4\f\0\5\0\1\0`\4\f"..., 280}], 1) = 280
select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout)


It's taking up memory in a rate of 1MB every ~15 seconds.
Comment 1 Dario Andres 2009-08-13 01:00:07 UTC
- Are you using the mplayerthumbnails plugin ? If you are, can you check if disabling it will stop this kio_thumb behaviour ?
Thanks
Comment 2 Txema 2009-08-20 01:48:39 UTC
I've also seen this behavior, when there are previews of images implicated the RAM goes up without stoping, with Dolphin it's the process kio_thunbnail, just now i had to reboot the pc because that process had eaten >80% of the RAM (2 GB), and when it's amarok, the RAM is eaten up by other process, X itself, this happen when you open the cover manager. (it's strange that although you close amarok, X won't free all the RAM, only a very little portion before: below 4% during: over 35% after: 26%)

Now i've disabled the video preview, though in none of the cases there were any videos.

Gentoo ~amd64
KDE 4.3.0
Comment 3 Txema 2009-08-21 19:19:33 UTC
Hi, after disabling video preview this behavior is still present, it appears when you have Dolphin open for some time, then kio_thumbnail begin to eats up memory and don't free it when you close Dolphin, you have to kill the process.

Oh, it's only a kio_thumbnail process, not several.
Comment 4 Reidaris 2009-08-27 19:20:20 UTC
I'm also joining this one for sure. Fired up my computer one day - came back a few hours later to a system almost grinding to a halt... around 4-5 GB of mem/virt was being used by two processes - kio-thumbnail. Dolphin's working directory (yes, i had fired up dolphin to view my /home) didn't have any multimedia files, so i wasn't quite sure what was going on. Easily enough to just kill the processes.

However, today i bumped into another similar issue w/ ram/CPU, was moving around 50GB of data out to a external HDD (plain move, no compression, dragging the data from one dolphin session/window to another), and i have one kio_thumbnail process eating around 1.2BG mem (and counting) and around 95-98% CPU on a athlon64 xp 6000+ while moving the files. At the same time i have another kio_thumbnail process at around 2GB mem.(565MB of RAM, rest swap).

If
Comment 5 Reidaris 2009-08-27 19:28:53 UTC
I'm also joining this one for sure. Fired up my computer one day - came back a few hours later to a system almost grinding to a halt... around 4-5 GB of mem/virt was being used by two processes - kio-thumbnail. Dolphin's working directory (yes, i had fired up dolphin to view my /home) didn't have any multimedia files, so i wasn't quite sure what was going on. Easily enough to just kill the processes.

However, today i bumped into another similar issue w/ ram/CPU, was moving around 50GB of data out to a external HDD (plain move, no compression, dragging the data from one dolphin session/window to another), and i have one kio_thumbnail process eating around 1.2BG mem (and counting) and around 95-98% CPU on a athlon64 xp 6000+ while moving the files. At the same time i have another kio_thumbnail process at around 2GB mem.(565MB of RAM, rest swap).

(gentoo ~amd64 multilib, kde4.3.0, nvidia-drivers 185.18.31, gcc4.4.1, gentoo-sources(kernel) 2.6.30-r5)

If there is anything more i should/need to report, please let me know. However, i might not be able to take the time of compiling with +debug, since i only use kde on my desktop machine (and the +kdeprefix flag has been removed for users)
Comment 6 migo 2009-08-27 19:31:11 UTC
Created attachment 36514 [details]
kio_thumbnail eats over 70% of memory

I have to confirm that bug also, after 1 day of uptime kio_thumbnail eats over 70% of memory.
Comment 7 Reidaris 2009-08-27 19:32:31 UTC
and i'm sry for the 1 1/2 posts, multitasking took it's toll this time :P
Comment 8 Christian Schmitt 2009-09-02 11:47:22 UTC
I can only confirm this issue with almost brings my quad core with 4 gigs of RAM to a complete halt. It is not video thumbnails that are the problem, it is big tif files that the KIO slave wants to create thumbnails from. I really hope that someone could look into this.
Comment 9 t-IX 2009-09-03 12:24:20 UTC
I also have this bug.

(gentoo ~amd64, kde4.3.1, nvidia-drivers 185.18.31, gcc4.4.1,
gentoo-sources(kernel) 2.6.30-r1)
Comment 10 Zsombor 2009-09-18 08:14:23 UTC
I have similar issue, with kde 4.3.0, gentoo/amd64.
Comment 11 Alexey Shildyakov 2009-09-18 11:05:58 UTC
Confirm it on Gentoo/~amd64

Hmm... Many people use Gentoo... Is it OS distributive dependent?
Comment 12 xenonism 2009-09-18 16:16:59 UTC
I'm also a Gentoo user, and running the Gentoo-flavored kernel. Is there any way I (or us Gentoo users) can help isolating the issue of finding out whether and how it is Gentoo-dependent?
Comment 13 Fest 2009-09-29 19:54:42 UTC
Confirm it on Gentoo amd64.
KDE 4.3.1, gcc-4.4.1, nvidia-drivers-185.18.31.

It's seem's like dolphin forget to free cache. More you browse with preview - more kio_thumbnail bloats, till it eats all free memory and freeze.
Comment 14 Alexey Shildyakov 2009-09-29 22:44:49 UTC
I have no preview for video files, but I have "Info" panel when video files are previewed. I think for me problem is this. As I select video preview in Dolphin settings.
Comment 15 sha 2009-10-02 22:17:45 UTC
I can confirm this bug on Gentoo/amd64, KDE 4.3.1, ati-drivers-9.9-r2, Gentoo Sources 2.6.30-r1.
Comment 16 sha 2009-10-02 22:18:40 UTC
Sorry, I meant 2.6.31-r1.
Comment 17 Alexey Shildyakov 2009-10-02 22:25:48 UTC
*** This bug has been confirmed by popular vote. ***
Comment 18 Dimitriy Ryazantcev 2009-10-15 18:50:52 UTC
Have this bug too.
Gentoo/~x86.
KDE 4.3.2, gcc-4.4.1, x11-drivers/xf86-video-ati-6.12.4.
Comment 19 James 2009-10-31 03:43:16 UTC
kio_thumbnail processes eat all my memory.
I think it is the dolphin previews.
There should be a system way to limit memory usage of kio_thumbnails.
Comment 20 Ivan D 2009-11-12 20:58:14 UTC
Same here. 
Gentoo amd64 nvidia kde 4.3.1
Comment 21 jp 2009-11-15 18:10:18 UTC
I can confirm this bug in PCLinuxOS 2009 with KDE 4.3.2

Happens with preview videos or panel information active, so disabling both is a sure way to prevent the problem.
Comment 22 Matías Costa 2009-12-01 16:22:04 UTC
Gentoo amd64 here. Removing mplayerthumbs solves the problem. It is clearly guilty.
Comment 23 Frédéric Branger 2009-12-06 20:01:39 UTC
It might be some luck till my next reboot but since I set the mplayerthumbs backend to mplayer instead of phonon in mpleyerthumbsconfig, I haven't encountered the bug
Comment 24 Dario Andres 2009-12-09 23:42:21 UTC
- Can anyone else experiencing this bug confirm that setting MPlayerThumbs to use MPlayer instead of Phonon (default) fixes this ? (you need to run the "mplayerthumbsconfig" helper application to setup this)
Thanks
Comment 25 Matías Costa 2009-12-10 01:10:50 UTC
Dario, I can confirm it. Rebuilding 189 videos with mixed format/size was OK. kio_thumbnail finished (with 23MB) when dolphin closed.
Comment 26 Piotr Mitas 2009-12-10 13:49:02 UTC
Looks like it works. I didn't even know of that mplayerthumbsconfig thing ;)
Comment 27 Marco Gulino 2009-12-10 15:39:56 UTC
thank you for reporting, i already saw problems on that code portion, but i thought i already fixed (almost) all of it..
Can you also tell me what's logged on console (search for 'videopreview: backend' something).
In the meantime, i'll rework this code chunk.
Comment 28 Matías Costa 2009-12-10 16:15:25 UTC
- With phonon empty folder with two videos (700MB each):

QObject::connect: Incompatible sender/receiver arguments
        Phonon::MediaObject::totalTimeChanged(qint64) --> PreviewingFile::setTotalTime(quint64)
No accelerated IMDCT transform found
QObject::connect: Incompatible sender/receiver arguments
        Phonon::MediaObject::totalTimeChanged(qint64) --> PreviewingFile::setTotalTime(quint64)
No accelerated IMDCT transform found
[mpeg4 @ 0xe737c10]header damaged
[mpeg4 @ 0x7f9a3b5eac10]warning: first frame is no keyframe

- With phonon when I place the cursor over the icon (please note there is no thumbnail):

QObject::connect: Incompatible sender/receiver arguments
        Phonon::MediaObject::totalTimeChanged(qint64) --> PreviewingFile::setTotalTime(quint64)
No accelerated IMDCT transform found
[mpeg4 @ 0x1782cd70]warning: first frame is no keyframe
QObject::connect: Incompatible sender/receiver arguments
        Phonon::MediaObject::totalTimeChanged(qint64) --> PreviewingFile::setTotalTime(quint64)
No accelerated IMDCT transform found

Last three lines repeats forever

- This is what I get with mplayer with the same two videos:

kdeinit4: preparing to launch /usr/lib64/kde4/kio_thumbnail.so
kioslave: ####### CRASH ###### protocol = thumbnail pid = 737 signal = 11

-- Thank you for the attention
Comment 29 Dario Andres 2009-12-17 16:04:38 UTC
*** Bug 219025 has been marked as a duplicate of this bug. ***
Comment 30 Ambroz Bizjak 2010-01-01 16:40:59 UTC
I suggest that mplayerthumbs be disabled until this bug is solved, as this is a serious memory leak.
Comment 31 Melendro 2010-01-01 17:14:51 UTC
(In reply to comment #30)
> I suggest that mplayerthumbs be disabled until this bug is solved, as this is a
> serious memory leak.

There is no need to disable mplayerthumbs. You can use the config tool (mplayerthumbsconfig) and select the MPlayer backend instead of the default phonon backend. There is no memory leak with this backend.
Comment 32 Ambroz Bizjak 2010-01-01 17:26:12 UTC
(In reply to comment #31)
> (In reply to comment #30)
> > I suggest that mplayerthumbs be disabled until this bug is solved, as this is a
> > serious memory leak.
> 
> There is no need to disable mplayerthumbs. You can use the config tool
> (mplayerthumbsconfig) and select the MPlayer backend instead of the default
> phonon backend. There is no memory leak with this backend.
This is not about how a user can work around the problem. The phonon backend is used by default, so pretty much all users of KDE are affected, even though they don't know it. Users shouldn't have to mess with configuration to work around bugs. If it doesn't work, it should be disabled.
So, yes, it would be better to only disable the phonon backend.
Comment 33 Frédéric Branger 2010-01-01 23:35:37 UTC
I am a bit unaware of the packaging issues and policies, but I think it is more sensible to set the mplayer backend by default than litterally disabling the feature.
It's quite eye-candy but useful for a modern desktop environment, and I think it has some importance in the current context of concurrency between OS or WM : it's a bit disappointing to discover that video thumbnails work fine everywhere except kde
Comment 34 Ambroz Bizjak 2010-01-02 03:32:27 UTC
I've found this project:
http://code.google.com/p/ffmpegthumbnailer/
It generates video thumbnails fast and reliably. I'll try to get its ThumbCreator plugin ingegrated into KDE to be used instead of the non-functional mplayerthumbs (in trunk the mplayer backend is also broken because it segfaults). The plugin is very small as it uses a library, so it shouldn't be hard to get it merged.
Comment 35 Marc Schiffbauer 2010-04-03 01:24:24 UTC
*** Bug 221262 has been marked as a duplicate of this bug. ***
Comment 36 Alexey Shildyakov 2010-05-30 11:03:16 UTC
Ok. Could it be to use Mplayer engine by default if mplayerthumbs is enabled?
Comment 37 David Heidelberg 2010-12-22 12:59:32 UTC
I can confirm that bug appear on KDE 4.6_beta2 with gwenview
Comment 38 Ignacio Serantes 2011-01-06 01:36:20 UTC
There is an alternative, kffmpegthumnailer, that really works without eating resources.

Tip: seems to be other bug because you need to uninstall mplayerthumbnailer before kffmpegthumbnailer works. Disabling the first and enabling the seconds is not enought, at least in my system.
Comment 39 Nate Graham 2018-06-29 21:15:56 UTC
mplayerthumbnailer no longer exists, and we use ffmpegthumbnailer now.