AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
May 2007

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date


The TIFF Mailing List Homepage
Archive maintained by AWare Systems

New Datamatrix section

Valid HTML 4.01!

2007.05.15 21:01 "Memory leak opening and closing files?", by Zak Frentz

Hi, I'm using libtiff v. 3.8.2 compiled with gcc on a Mac G5 with OS X 
10.4.9.  I am trying to open, and read several thousand 16-bit grayscale 
TIFFs, in a serial fashion.  I noticed that memory was quickly 
decreasing as I did this, at the rate of about 10Mb per second!  I tried 
just TIFFOpen and TIFFClose on each file in the list, and still the free 
memory decreases, though about 10x slower.  Here is some code:

    TIFF *img;
    for (i = 0; i < n_files; i++) {
       img = TIFFOpen(file_names[i], "r");
       if (img != NULL)
       else {
          fprintf(stderr, "Could not open file %s\n", file_names[i]);

Any ideas on solving this problem?  Thanks!