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: Tassilo Horn
Subject: Re: Using the ImageMagick backend seems to leak memory
Date: Fri, 07 Jan 2011 09:28:12 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Miles Bader <address@hidden> writes:

>>> I just noticed that my emacs uses up more than a gigabyte memory.
>>> It is because of doc-view with ImageMagick backend.
>>> 
>> I met same issue.
>
> My impression is that in general, ImageMagick does not aim at memory
> efficiency (that's why I don't want to use its libraries for my own
> image I/O needs, event though doing so would be pretty convenient).

Well, not being memory efficiency and not giving back memory at all is a
minor difference. ;-)

I've just opened a doc-view page-x.png with ImageMagick's display tool.
The behavior is identical, e.g., it reserves ~30MB per PNG and only
gives back memory when I close the program.  So I presume, ImageMagick
has some cache that gets at least cleared when the process is killed.
I'm sure, there's some C function you can call to clear it...

Looking at the API, there's

--8<---------------cut here---------------start------------->8---
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.
--8<---------------cut here---------------end--------------->8---

In the emacs sources, that function's never called.  So that's probably
the source of the leak.

Bye,
Tassilo



reply via email to

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