Bug 325712 - Face tagging has massive memory leak
Summary: Face tagging has massive memory leak
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Engine (show other bugs)
Version: 3.4.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
Depends on:
Reported: 2013-10-06 17:44 UTC by René Fritz
Modified: 2019-12-23 07:37 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0
Sentry Crash Report:

memory graph with comments (70.40 KB, image/png)
2013-10-06 17:45 UTC, René Fritz

Note You need to log in before you can comment on or make changes to this bug.
Description René Fritz 2013-10-06 17:44:09 UTC
When you tag faces digikam eats all available meory in short time.
I'll add a screentshot of a memory graph.

Bug #323253 might be related.
Because of the bug report I deleted recognition.db and all works fine. Also tagging, but after editing/tagging hundreds of faces the proplem reappear.
recognition.db is 184M big now.

Reproducible: Always

Steps to Reproduce:
1. Go to 'people' view
2. Start tagging faces
3. Doesn't matter if you stop tagging - memory consumption goes on
Actual Results:  
In less than 5 minutes (often in much shorter time) all available memory is used: 8G Ram + 8G swap.

Expected Results:  
Don't eat all my memory :-)

I'm running Digikam on Kubuntu saucy, KDE 4.11.2
The Kubuntu packages of Digikam 3.3.0 showed the same bahaviour.
I compiled Digikam from sources which is 4.0.0-beta1
Build date: Oct 5 2013 (target: debugfull)
Rev.: 5983eeb8adcbcb3e4d32ec1cdf6304b3ae7f258a

digiKam version 4.0.0-beta1
CANON-CR2: 662
JPEG: 804
JPG: 38967
PNG: 35
RAW-CR2: 24066
TIFF: 25
XCF: 5
total: 64662
3GP: 10
AVI: 74
JPG: 2
M4V: 30
MKV: 1
MOV: 130
MP4: 191
MPEG: 142
total: 580
Total Items: 65242
Albums: 484
Tags: 236
Database backend: QSQLITE
Comment 1 René Fritz 2013-10-06 17:45:14 UTC
Created attachment 82691 [details]
memory graph with comments
Comment 2 René Fritz 2013-10-06 18:56:04 UTC
Additional information: You can not end digikam when this happens. The gui disapears, but the process ist still running and eats memory. sigterm ends digikam.
Comment 3 René Fritz 2013-10-18 15:53:48 UTC
Just tested 3.4 kubuntu packages. The same problem.
Comment 4 caulier.gilles 2013-12-23 17:57:18 UTC
*** Bug 329164 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Fischer 2013-12-27 18:58:56 UTC
I am facing the same issue, running openSuSE Tumbleweed with Kernel 3.12 and KDE 4.11.3.
The face recognition requires a lot of memory in general and there is no switch or so to limit it.

As the guys before me wrote Digicam will eat up all available memory even swap. I upgraded my system today to 16GB RAM plus 120GB SSD swap. When working with face recognition for 5000 pictures is it just a matter of memory bandwith until Digikam allocated more than 40GB of memory.

Read, write and delete to RAM continues but no progress in operation can be detected. For me it stay in status "Applying face changes" for hours when I made changes to 100-200 pictures.
Comment 6 Ingo 2013-12-30 20:33:50 UTC
I have the same Issue in digiKam 3.4.0 on Kubuntu 13.10 KDE 4.11.3
Comment 7 caulier.gilles 2014-01-06 13:08:52 UTC

*** This bug has been marked as a duplicate of bug 323888 ***
Comment 8 Maik Qualmann 2017-12-17 19:21:32 UTC
Git commit 6a9fd9891a3ff341dc42fe36158cbf0101d513b6 by Maik Qualmann.
Committed on 17/12/2017 at 19:20.
Pushed by mqualmann into branch 'master'.

delete threads from memory when they are finished
Related: bug 375317, bug 375035, bug 321784, bug 328732, bug 330227, bug 331912, bug 344661, bug 345395, bug 350549, bug 381877, bug 338249, bug 329651, bug 329091, bug 387821, bug 381222

M  +2    -1    NEWS
M  +25   -0    libs/database/dbjobs/dbjobsmanager.cpp
M  +35   -0    libs/iojobs/iojobsmanager.cpp

Comment 9 caulier.gilles 2017-12-17 20:01:34 UTC
Following this commit:


... the approach to fix this problem is under way and new digiKam 5.8.0 pre-release bundles will be compiled tonight to lets a chance to end-users to give a feedback about this fix before the 5.8.0 official release planed before Christmas 2017.

The bundles will be available in 2 hours at this url:


Please do not waste time to test if this file is always valid for next 5.8.0.

Thanks in advance

Gilles Caulier
Comment 10 caulier.gilles 2019-12-23 07:37:22 UTC
Problem is fixed with new 7.0.0-beta1 through this long story from this bug


You can test digiKam 7.0.0-beta1 with bundle available here:


Don't hesitate to give us a fresh feedback about his entry.

Thanks in advance

Gilles Caulier