Bug 262012

Summary: ThumbnailView requests video preview over and over again when requests fail
Product: [Applications] kphotoalbum Reporter: Risto H. Kurppa <risto>
Component: Thumbnail ViewerAssignee: KPhotoAlbum Bugs <kpabugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: SVN trunk (KDE4 version)   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Risto H. Kurppa 2011-01-03 22:53:56 UTC
4.1.1+svn1210839-0ubuntu0~ppa4 from https://launchpad.net/~dominik-stadler/+archive/ppa

I had left kphotoalbum --demo running for around 4 hours and my computer felt a bit sluggish. I ran htop to see what's happening. These are the values for KPhotoAlbum:
80% CPU (Core2Duo 2.4GHz or so)
1.7G VIRT
0.9G RES

I was surprised by this. So I restarted KPA and saw this:

0% CPU
437M VIRT
58M RES
Comment 1 Jan Kundrát 2011-01-04 08:29:37 UTC
What's your value for the amount of memory used for caching decoded images?

Also, have you watched any videos?
Comment 2 Risto H. Kurppa 2011-01-04 08:42:18 UTC
How do I check memory used for caching decoded images

No, didn't watch videos

I left kphotoalbum --demo on over night, on home view, didn't touch anything, just start.
After about 8 hours around 380M of memory (VIRT) and 0% CPU.

Now when I click 'show thumbnails', CPU goes very high (70-80%) but KPA doesn't show it'd work on thumbnails or anything - and memory (RES) keeps on growing slowly.

Going back to home stops CPU usage back to 0% and memory footprint also stops from growing.

The same actually happens without waiting for hours: As soon as I click on 'view thumbnails' on a newly started process, CPU goes high (to 70-80%) and stays there, and memory footprint keeps on growing slowly. So along the time it uses huge amounts of memory.
Comment 3 Jan Kundrát 2011-01-04 09:15:57 UTC
OK, looks like one has to have a broken KDE-level support for video thumbnails and open a list of thumbnails with some (hidden?) videos; when that happens, the ImageManager::VideoManager::load() is being called way too often and the same videos get requested over and over again.

I haven't checked yet if the bug is in the ThumbnailView or in the ImageManager code.

Sorry for premature closing and thanks for feedback, reopening now.
Comment 4 Risto H. Kurppa 2011-01-04 09:19:47 UTC
Yes, debugged this in IRC with Jan, here's the 'simple explanation' ;)

I noticed that I didn't see video thumb of the --demo. Found out that I didn't have mplayerthumbs installed - so no video thumbs. 

home -> media type -> photos -> show thumbnails -> everything looks good
home -> media type -> video -> show thumbnails  -> CPU up to 60-80% and RES keeps on growing

Installing mplayerthumbs
home -> media type -> video -> show thumbnails  -> everything looks good.

Jan's results above. Thanks Jan!!
Comment 5 Miika Turkia 2012-02-08 13:48:14 UTC
Fixed in commit a993d0377adcb10df2568e460afed2414a4654bf