Return-Path: <tiff-bounces@lists.maptools.org>
Received: from mailgate105.isp.belgacom.be (mailgate105.isp.belgacom.be [195.238.6.86])
        by inmx015.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l4FLIRxv023928
        for <joris.at.lebbeke@skynet.be>; Tue, 15 May 2007 23:18:28 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 15 May 2007 23:18:26 +0200
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l4FL3ImO008968;
	Tue, 15 May 2007 17:04:25 -0400
Received: from smtp1.rockefeller.edu (smtp1.rockefeller.edu [129.85.120.103])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l4FL3F1B008963
	for <tiff@lists.maptools.org>; Tue, 15 May 2007 17:03:16 -0400
Received: from [129.85.178.11] (dhcp-129-85-178-11.rockefeller.edu
	[129.85.178.11])
	by smtp1.rockefeller.edu (Switch-3.1.11/Switch-3.1.11) with ESMTP id
	l4FL3CeS011823
	for <tiff@lists.maptools.org>; Tue, 15 May 2007 17:03:12 -0400 (EDT)
Message-ID: <464A1F98.1030809@rockefeller.edu>
Date: Tue, 15 May 2007 17:01:12 -0400
From: Zak Frentz <zfrentz@mail.rockefeller.edu>
User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221)
MIME-Version: 1.0
To: tiff@lists.maptools.org
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-MASF: 0.00%
Subject: [Tiff] Memory leak opening and closing files?
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00002390
X-MSP-STORE: Tue, 15 May 2007 23:18:31 +0200
Status:   

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)
          TIFFClose(img);
       else {
          fprintf(stderr, "Could not open file %s\n", file_names[i]);
          break;
       }
    }

Any ideas on solving this problem?  Thanks!

Zak
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
