Return-Path: <tiff-bounces@lists.maptools.org>
Delivered-To: info@awaresystems.be
Received: (qmail 9261 invoked from network); 14 Nov 2008 19:13:28 -0000
Received: from jack.telenet-ops.be ([195.130.136.5])
          (envelope-sender <tiff-bounces@lists.maptools.org>)
          by angelia.telenet-ops.be (qmail-ldap-1.03) with SMTP
          for <info@awaresystems.be>; 14 Nov 2008 19:13:28 -0000
Received: from waldo.telenet-ops.be (waldo.telenet-ops.be [195.130.136.10])
	by jack.telenet-ops.be (8.13.1/8.13.1) with ESMTP id mAEJDSxY016850
	for <info@awaresystems.be>; Fri, 14 Nov 2008 20:13:28 +0100
Received: from localhost (localhost.localdomain [127.0.0.1])
	by waldo.telenet-ops.be (Postfix) with SMTP id B2B7D1C004
	for <info@awaresystems.be>; Fri, 14 Nov 2008 20:13:28 +0100 (CET)
Received: from crotus.telenet-ops.be (crotus.telenet-ops.be [195.130.132.38])
	by waldo.telenet-ops.be (Postfix) with ESMTP id A2A0A1C002
	for <info@awaresystems.be>; Fri, 14 Nov 2008 20:13:28 +0100 (CET)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153])
	by crotus.telenet-ops.be (Postfix) with ESMTP id 40B7C1A
	for <info@awaresystems.be>; Fri, 14 Nov 2008 20:13:28 +0100 (CET)
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 mAEJBu8E001438;
	Fri, 14 Nov 2008 14:12:26 -0500
Received: from sasl.smtp.pobox.com (a-sasl-fastnet.sasl.smtp.pobox.com
	[207.106.133.19])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id mAEJBsas001434
	for <tiff@lists.maptools.org>; Fri, 14 Nov 2008 14:11:54 -0500
Received: from localhost.localdomain (unknown [127.0.0.1])
	by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id
	837677DBD2; Fri, 14 Nov 2008 14:11:52 -0500 (EST)
Received: from [192.168.2.4] (unknown [67.47.28.121]) (using TLSv1 with
	cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate
	requested)
	by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id
	3FC247DBCB; Fri, 14 Nov 2008 14:11:32 -0500 (EST)
Message-ID: <491DCD55.2050501@pobox.com>
Date: Fri, 14 Nov 2008 14:11:17 -0500
From: Frank Warmerdam <warmerdam@pobox.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
MIME-Version: 1.0
To: Ilkka.Korpela@Helsinki.fi
Subject: Re: [Tiff] Memory leak (TIFFOpen, TIFFReadTile)?
References: <20081114102912.182940jlte5kpjh4@webmail.helsinki.fi>
	<Pine.SOC.4.64.0811141147180.15560@freddy.simplesystems.org>
	<20081114203719.46681rq6wc3891sv@webmail.helsinki.fi>
In-Reply-To: <20081114203719.46681rq6wc3891sv@webmail.helsinki.fi>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Pobox-Relay-ID: 185C90D4-B280-11DD-8DC7-9CEDC82D7133-06493634!a-sasl-fastnet.pobox.com
Cc: tiff@lists.maptools.org
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-SpamCatcher-Score: 10 [X]

Ilkka Korpela wrote:
> Quoting "Bob Friesenhahn" <bfriesen@simple.dallas.tx.us>:
> 
> Bob
> 
>   Thanks. I found a way out of the memory consumption
> by calling TIFFClose() and TIFFOpen in between rows of
> TILES (inside the double loop). This way the consumption
> (leak) stays < 25 MB with these huge images, which is
> tolerable. Memory is freed when TIFFClose() is called.
> 
> ilkka Salo Finland

ilkka,

It really sounds like you are mixup up process size with heap memory use.
Many tools that report a processes size will also report all the memory
currently used by pages of a disk file that are paged into memory as part
of the io subsystem.  This is not real heap use, and the memory will be
released by the operating system as soon as it is needed for something
else.  Till then the disk pages are left in memory in case they are needed
again.  This is consistent with the memory use dropping on close.

In my opinion, some care should be taken before reporting "memory leaks"
based on summary process memory use tools.  I generally disregard these
sorts of reports under the assumption the reporter just doesn't know what
they are doing.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

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