Bug 272031

Summary: BQM wastes a lot of memory when adding over 3000 files
Product: [Applications] digikam Reporter: Andi Clemens <andi.clemens>
Component: BatchQueueManager-WorkflowAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 2.0.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.0.0

Description Andi Clemens 2011-04-30 09:22:19 UTC
Version:           2.0.0 (using KDE 4.6.2) 
OS:                Linux

When you add a lot of images to the BQM, it get stuck and wastes a lot of memory. I guess this is due to the thumbnail generation, which takes an awful lot of time.
Do we really need to display this little thumbnail in there anyway, it doesn't give the user any advantage, all operations are executed on the queue itself, so selecting individual images based on their thumbnails is no use case here.

Maybe we should add an option for turning them off in such dialogs, like in BQM or in the progress dialogs (ThumbnailBatch, FingerprintsBatch).

Reproducible: Always




OS: Linux (i686) release 2.6.38-ARCH
Compiler: gcc
Comment 1 Marcel Wiesweg 2011-04-30 18:21:48 UTC
I didn't look in the implementation, but from what you tell the current process is:
3000 files added -> 3000 thumbnails requested -> 3000 pixmaps stored.

What generally scales very well would be:

3000 files added -> added to a model -> n files displayed -> n thumbnails requested -> n thumbnails cached -> n thumbnails drawn from cache
where n is small (depending on widget's size)

This is how it's basically done in the main icon view.
Comment 2 Andi Clemens 2011-04-30 19:47:23 UTC
Yes, this would help I guess. Right now all thumbnails are requested, which is not scaling very well. I needed to wait 5 minutes for digiKam being responsive again.
Comment 3 caulier.gilles 2011-06-22 14:23:54 UTC
Git commit b6f76fa0836d2798df7e1e5acdb08f417197a52c by Gilles Caulier.
Committed on 22/06/2011 at 14:21.
Pushed by cgilles into branch 'master'.

BQM : use a mechanism to only load thumb from a queue when item must be show.
Marcel, i don't use Model/View here. I re-implemented QTreeWidget::drawRow() which query thumbnail loader when it's necessary
BUGS: 272031

M  +23   -5    utilities/queuemanager/views/queuelist.cpp     
M  +6    -2    utilities/queuemanager/views/queuelist.h     

http://commits.kde.org/digikam/b6f76fa0836d2798df7e1e5acdb08f417197a52c
Comment 4 Andi Clemens 2011-06-22 23:10:54 UTC
Seems to work fine...