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: Mon, 10 Jan 2011 22:47:51 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

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



reply via email to

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