emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using the ImageMagick backend seems to leak memory


From: joakim
Subject: Re: Using the ImageMagick backend seems to leak memory
Date: Tue, 11 Jan 2011 19:11:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Tassilo Horn <address@hidden> writes:

> address@hidden writes:
>
>>> ClearMagickWand() clears resources associated with the wand.
>>> The format of the ClearMagickWand method is:
>>>
>>>   void ClearMagickWand(MagickWand *wand)
>>>
>>> A description of each parameter follows:
>>> wand
>>>   the magick wand.
>>>
>>> In the emacs sources, that function's never called.  So that's
>>> probably the source of the leak.
>>
>> Hmm. We can try.
>
> Andreas already added DestroyMagickWand() calls that imply clearing, and
> I locally added MagickWandTerminus() calls.  Right now, I presume the
> leak is not on the IM side.
>
> Your patch in the other mail (I'll try it later) seems to support that
> guess.

I've looked at this a little bit further.

The error is that the image read with ReadImage is cloned by
NewMagickWandFromImage not refered as I believed when I wrote the code.

The code was written that way to avoid another memory problem I
experienced with image bundles. If the current strategy remains,
DestroyImage(im_image); should be the right fix.

However, the strategy should probably be changed to avoid the
cloning. This will result in a more complex code path.


>
>> Anyway i asked the IM team:
>> http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=17819>
>> Some other things:
>> - Do you see the issue only when scaling?
>
> No, always.
>
>> - Only with PNG? Or also JPG?
>
> I tested with PNG and TIF, and both have the problem.
>
> Bye,
> Tassilo

-- 
Joakim Verona



reply via email to

[Prev in Thread] Current Thread [Next in Thread]