From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-devel@gnu.org
Subject: Re: Using the ImageMagick backend seems to leak memory
Date: Mon, 10 Jan 2011 22:47:51 +0100 [thread overview]
Message-ID: <877heca0s8.fsf@member.fsf.org> (raw)
In-Reply-To: <87sjx6zczl.fsf@member.fsf.org> (Tassilo Horn's message of "Thu, 06 Jan 2011 08:51:26 +0100")
Hi all,
I've just tried to add some debug statements to one of the MagickWand
example programs (see below). When I invoke that program on some very
large TIF (~300 MB) or PNG file, the memory consumption shortly
increases, but after destroying the MagickWand and calling
MagickWandTerminus(), all memory is freed.
Here's the code:
--8<---------------cut here---------------start------------->8---
#include <stdio.h>
#include <stdlib.h>
#include <wand/MagickWand.h>
int main(int argc,char **argv)
{
MagickBooleanType status;
MagickWand *magick_wand;
if (argc != 3)
{
(void) fprintf(stdout,"Usage: %s image thumbnail\n",argv[0]);
exit(0);
}
MagickWandGenesis();
magick_wand=NewMagickWand();
fprintf(stdout,"Created magick wand.\n");
status=MagickReadImage(magick_wand,argv[1]);
MagickResetIterator(magick_wand);
while (MagickNextImage(magick_wand) != MagickFalse)
MagickResizeImage(magick_wand,106,80,LanczosFilter,1.0);
status=MagickWriteImages(magick_wand,argv[2],MagickTrue);
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
fprintf(stdout,"Terminated magick wand & sleeping 20 secs.\n");
sleep (20);
fprintf(stdout,"Bye.\n");
return(0);
}
--8<---------------cut here---------------end--------------->8---
Currently, I cannot see where's the difference between that code and the
one in image.c...
Bye,
Tassilo
next prev parent reply other threads:[~2011-01-10 21:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 7:51 Using the ImageMagick backend seems to leak memory Tassilo Horn
2011-01-06 9:02 ` joakim
2011-01-06 10:20 ` Tassilo Horn
2011-01-07 4:17 ` Jashy
2011-01-07 4:59 ` Miles Bader
2011-01-07 6:27 ` Stephen J. Turnbull
2011-01-07 7:25 ` Miles Bader
2011-01-07 8:28 ` Tassilo Horn
2011-01-07 22:39 ` Andreas Schwab
2011-01-10 10:34 ` Tassilo Horn
2011-01-10 13:28 ` Jashy
2011-01-10 13:56 ` Tassilo Horn
2011-01-10 14:36 ` Jashy
2011-01-11 10:14 ` Jashy
2011-01-11 10:59 ` joakim
2011-01-11 14:17 ` joakim
2011-01-11 14:38 ` joakim
2011-01-11 17:43 ` Tassilo Horn
2011-01-11 18:11 ` joakim
2011-01-11 19:10 ` Tassilo Horn
2011-01-11 19:35 ` joakim
2011-01-11 19:55 ` Tassilo Horn
2011-01-12 1:47 ` Stefan Monnier
2011-01-12 7:37 ` Tassilo Horn
2011-01-10 21:47 ` Tassilo Horn [this message]
2011-01-11 8:47 ` Tassilo Horn
2011-01-11 9:35 ` joakim
2011-01-11 9:53 ` Tassilo Horn
2011-01-11 9:54 ` joakim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877heca0s8.fsf@member.fsf.org \
--to=tassilo@member.fsf.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).