[Bug 289680] New: ICCProfile wastes a lot of memory (high memory footprint on startup)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 289680] New: ICCProfile wastes a lot of memory (high memory footprint on startup)

Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680

           Summary: ICCProfile wastes a lot of memory (high memory
                    footprint on startup)
           Product: digikam
           Version: 2.5.0
          Platform: Compiled Sources
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: Color Management
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


Version:           2.5.0 (using KDE 4.7.3)
OS:                Linux

Hi,

I wanted to check why digiKam has such a high memory footprint when it just
starts (180 MB on my system), and one reason I found are the ICCProfiles.
We read the profiles from the hardddisk (in my case: /usr/share/color/icc),
which contains 25 MB of data. We load those bytes into memory, but also
create an cmsHPROFILE in IccProfile::open(), which also contains those 25 MB in
the end.
So when loading ICCSettings, digiKam already wastes 50 MB of RAM.

Sure we need to load the ICCSettings, but we do not need the data twice.
Wouldn't it be enough to just keep the cmsHPROFILE handle in ICCProfile
(d->handle), and delete the data (d->data) after successful loading of the
profile?

This will prevent us from wasting a lot of RAM.
Unfortunately, a lot of functions need to be changed to work only with the
handle (if that is even possible).

Andi

Reproducible: Always

Steps to Reproduce:
start digiKam

Actual Results:  
memory is allocated twice

Expected Results:  
should be allocated once

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 289680] ICCProfile wastes a lot of memory (high memory footprint on startup)

Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680





--- Comment #1 from Andi Clemens <andi clemens googlemail com>  2011-12-23 16:46:04 ---
In bool CIETongueWidget::setProfileData(const QByteArray& profileData), we take
the profile data and (again) create a new cmsPROFILE object. Taking a look at
the memory usage with massif and the "taskmanager", it seems like again 25 MBs
are allocated.
Can't we use the already existing handle of the ICCProfile object here and pass
it as a reference to this method?

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 289680] ICCProfile wastes a lot of memory (high memory footprint on startup)

Gilles Caulier-4
In reply to this post by Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680


Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #2 from Gilles Caulier <caulier gilles gmail com>  2011-12-23 18:07:18 ---
Andi,

I think it's fine. But take a care that lcms is not re-entrant in version 1.x.
In 2.x it's fixed but a lot of code need to be ported in digiKam.

So, you can try as well and look if in intensive workflow using CM, all work
fine.

Marcel has written this CM interface, but he is certainly in vacancy. In all
case i meet him in January at Genoa, i will remember to talk about it.

Gilles Caulier

Gilles

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 289680] ICCProfile wastes a lot of memory (high memory footprint on startup)

Marcel Wiesweg
In reply to this post by Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680





--- Comment #3 from Marcel Wiesweg <marcel wiesweg gmx de>  2011-12-26 21:19:11 ---
The cmsHProfile handle is needed to use the profile with lcms - already to
retrieve metadata such as description. The data is needed to compare two
profiles for identity, and to embed a profile into an image. As far as I know,
there is no way to retrieve the original data from the cmsHProfile handle.

Originally, the intention was to open all profiles, read the decription, then
close them again to free memory. Apparently, that does not work but I never
investigated.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 289680] ICCProfile wastes a lot of memory (high memory footprint on startup)

Gilles Caulier-4
In reply to this post by Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680

--- Comment #4 from Gilles Caulier <[hidden email]> ---
Andi,

Since digiKAm support LCMS2, this entry still valid ?

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 289680] ICCProfile wastes a lot of memory (high memory footprint on startup)

Gilles Caulier-4
In reply to this post by Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680

--- Comment #5 from Gilles Caulier <[hidden email]> ---
Andi,

Do you seen my previous comment ?

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 289680] ICCProfile wastes a lot of memory (high memory footprint on startup)

Gilles Caulier-4
In reply to this post by Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680

--- Comment #6 from Gilles Caulier <[hidden email]> ---
Marcel, MAik,

I cannot reproduce the problem with LCMS2. At least memory finger print is not
too huge due to CM.

Can you reproduce the problem ?

If not so, as LCMS1 is removed in KF5 port, we will able to close this bug with
5.0.0 release.

Gilles

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 289680] ICCProfile wastes a lot of memory (high memory footprint on startup)

bugzilla_noreply
In reply to this post by Andi Clemens
https://bugs.kde.org/show_bug.cgi?id=289680

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Version Fixed In|                            |5.1.0
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #7 from [hidden email] ---
Since 5.0.0 we use only LCMS2 and this problem is not visible anymore in
valgrind

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel