Bug 324917 - digiKam: loading of tag icons fails -> very high CPU usage and freezing GUI [callgrind].
Summary: digiKam: loading of tag icons fails -> very high CPU usage and freezing GUI [...
Alias: None
Product: digikam
Classification: Unclassified
Component: Tags-Engine (show other bugs)
Version: 3.4.0
Platform: Gentoo Packages Linux
: NOR grave (vote)
Target Milestone: ---
Assignee: Digikam Developers
Depends on:
Reported: 2013-09-14 21:31 UTC by Frank Steinmetzger
Modified: 2022-01-22 14:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.6.0

Screenshot of KCacheGrind with the perpretrating function. (79.23 KB, image/png)
2013-09-14 21:31 UTC, Frank Steinmetzger

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Steinmetzger 2013-09-14 21:31:14 UTC

I upgraded from 3.2 to 3.4 today. When I opened digikam afterwards, the GUI was extremely sluggish, moving the mouse over anything took very long and CPU load was always 100% on one core.

I managed to narrow it down to the tags tree. If it is not visible, then browsing works fast as usual, albeit still generally a bit slow-ish. If I open the tag filter sidebar, then digikam hangs for a while and then returns to normal. It will also hang if I move the mouse over the tag tree. If I open the tag editing sidebar, then browsing images becomes very slow, too, because the tree needs to be updated for every image.

Also, instead of the usual icons, I have question mark icons in front of all tags.

So it seems something is very wrong with loading tag information. For profiling, I loaded digikam into valgrind and opened the tag filter sidebar. I waited for it to open and settle down in terms of CPU load. Then I enabled callgrind through SSH (so I don't have to switch programs which would fudge the measurement) and only moved the mose a bit over the tag tree. Once the CPU load had settled again, I switched callgrind off. See attached KCacheGrind’s output for the measurement.

It seems that loading icons for the tags is the problem...
99.7% of the time that the CPU spends heating my room is in KIconLoader::loadIcon.
The database used has 199 tags, 13002 images and 16696 imagetags.

I rebuild digikam with debug symbols enabled. So if you want me to debug more specifically, please let me know.

Reproducible: Always
Comment 1 Frank Steinmetzger 2013-09-14 21:31:46 UTC
Created attachment 82324 [details]
Screenshot of KCacheGrind with the perpretrating function.
Comment 2 Frank Steinmetzger 2013-09-14 21:38:40 UTC
I just noticed: it’s not just tag icons. There are missing icons in the main toolbar as well, and also in the main menu, which cause a small freeze during opening of every affected menu.
Comment 3 Jekyll Wu 2013-09-15 01:00:26 UTC
The problem of missing icon  is bug 324574 (fixed in 4.11.2)
Comment 4 Frank Steinmetzger 2013-09-15 01:43:25 UTC
I see, thanks for the hint. Indeed I’m running 4.11.1. Marking as invalid then since it’s not Digikam’s fault.