[Digikam-devel] [digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier caulier.gilles at gmail.com
Sat Oct 26 09:13:23 BST 2013


https://bugs.kde.org/show_bug.cgi?id=326525

Gilles Caulier <caulier.gilles at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marcel.wiesweg at gmx.de

--- Comment #24 from Gilles Caulier <caulier.gilles at gmail.com> ---
Marcel,

Running digiKam into valgrind give me these backtraces :

There is a lots of memory allocation into ThumbnailImageCatcher. This is not a
memory leak. When digiKam is stopped, all memory is free properly. Look below :

==7668== 7,128,144 bytes in 15,102 blocks are possibly lost in loss record
25,758 of 25,761
==7668==    at 0x4C285F1: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7668==    by 0x80B40EE:
QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::node_construct(QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::Node*,
Digikam::ThumbnailImageCatcher::Private::CatcherResult const&) (qlist.h:372)
==7668==    by 0x80B2D2D:
QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::append(Digikam::ThumbnailImageCatcher::Private::CatcherResult
const&) (qlist.h:512)
==7668==    by 0x80B197E:
QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::operator<<(Digikam::ThumbnailImageCatcher::Private::CatcherResult
const&) (qlist.h:334)
==7668==    by 0x80AFC76:
Digikam::ThumbnailImageCatcher::slotThumbnailLoaded(Digikam::LoadingDescription
const&, QImage const&) (thumbnailloadthread.cpp:1142)
==7668==    by 0x80ABB70:
Digikam::ThumbnailImageCatcher::qt_static_metacall(QObject*, QMetaObject::Call,
int, void**) (thumbnailloadthread.moc:172)
==7668==    by 0xF9AE8CE: QMetaObject::activate(QObject*, QMetaObject const*,
int, void**) (in /usr/lib64/libQtCore.so.4.8.5)
==7668==    by 0x808FCEA:
Digikam::LoadSaveThread::signalThumbnailLoaded(Digikam::LoadingDescription
const&, QImage const&) (loadsavethread.moc:174)
==7668==    by 0x8090538:
Digikam::LoadSaveThread::thumbnailLoaded(Digikam::LoadingDescription const&,
QImage const&) (loadsavethread.cpp:204)
==7668==    by 0x80ADFEC:
Digikam::ThumbnailLoadThread::thumbnailLoaded(Digikam::LoadingDescription
const&, QImage const&) (thumbnailloadthread.cpp:684)
==7668==    by 0x80B5565: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:229)
==7668==    by 0x809029C: Digikam::LoadSaveThread::run()
(loadsavethread.cpp:136)
==7668== 
==7668== 335,044,008 bytes in 709,839 blocks are possibly lost in loss record
25,761 of 25,761
==7668==    at 0x4C285F1: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7668==    by 0x80B40EE:
QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::node_construct(QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::Node*,
Digikam::ThumbnailImageCatcher::Private::CatcherResult const&) (qlist.h:372)
==7668==    by 0x80B2D59:
QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::append(Digikam::ThumbnailImageCatcher::Private::CatcherResult
const&) (qlist.h:521)
==7668==    by 0x80B197E:
QList<Digikam::ThumbnailImageCatcher::Private::CatcherResult>::operator<<(Digikam::ThumbnailImageCatcher::Private::CatcherResult
const&) (qlist.h:334)
==7668==    by 0x80AFC76:
Digikam::ThumbnailImageCatcher::slotThumbnailLoaded(Digikam::LoadingDescription
const&, QImage const&) (thumbnailloadthread.cpp:1142)
==7668==    by 0x80ABB70:
Digikam::ThumbnailImageCatcher::qt_static_metacall(QObject*, QMetaObject::Call,
int, void**) (thumbnailloadthread.moc:172)
==7668==    by 0xF9AE8CE: QMetaObject::activate(QObject*, QMetaObject const*,
int, void**) (in /usr/lib64/libQtCore.so.4.8.5)
==7668==    by 0x808FCEA:
Digikam::LoadSaveThread::signalThumbnailLoaded(Digikam::LoadingDescription
const&, QImage const&) (loadsavethread.moc:174)
==7668==    by 0x8090538:
Digikam::LoadSaveThread::thumbnailLoaded(Digikam::LoadingDescription const&,
QImage const&) (loadsavethread.cpp:204)
==7668==    by 0x80ADFEC:
Digikam::ThumbnailLoadThread::thumbnailLoaded(Digikam::LoadingDescription
const&, QImage const&) (thumbnailloadthread.cpp:684)
==7668==    by 0x80B5565: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:229)
==7668==    by 0x809029C: Digikam::LoadSaveThread::run()
(loadsavethread.cpp:136)

Typically, ThumbnailImageCatcher is called in ThumbsTask from maintenance tool
:

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/utilities/maintenance/thumbstask.cpp#L76

and ThumbnailImageCatcher store thumbs in a QList cache here, without limit :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/threadimageio/thumbnailloadthread.cpp#L1142

... until memory is full...

Question : there is something missing in ThumbsTask::run() to prevent this
problem ?

Gilles

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list