Return-Path: <tiff-bounces@lists.maptools.org>
Delivered-To: info@awaresystems.be
Received: (qmail 2533 invoked from network); 14 Nov 2008 23:24:44 -0000
Received: from cliffy.telenet-ops.be ([195.130.136.2])
          (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 23:24:44 -0000
Received: from zimbu.telenet-ops.be (zimbu.telenet-ops.be [195.130.136.11])
	by cliffy.telenet-ops.be (8.13.1/8.13.1) with ESMTP id mAENOiSv014929
	for <info@awaresystems.be>; Sat, 15 Nov 2008 00:24:44 +0100
Received: from localhost (localhost.localdomain [127.0.0.1])
	by zimbu.telenet-ops.be (Postfix) with SMTP id 4C8BF40003
	for <info@awaresystems.be>; Sat, 15 Nov 2008 00:24:44 +0100 (CET)
Received: from circe.telenet-ops.be (circe.telenet-ops.be [195.130.132.51])
	by zimbu.telenet-ops.be (Postfix) with ESMTP id 465EB40002
	for <info@awaresystems.be>; Sat, 15 Nov 2008 00:24:44 +0100 (CET)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153])
	by circe.telenet-ops.be (Postfix) with ESMTP id 05C5433E87
	for <info@awaresystems.be>; Sat, 15 Nov 2008 00:24:43 +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 mAENNtbV006447;
	Fri, 14 Nov 2008 18:24:01 -0500
Received: from cerious.com (mail.cerious.com [66.193.70.90])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id mAENKNSb006348
	for <tiff@lists.maptools.org>; Fri, 14 Nov 2008 18:20:24 -0500
Received: from [192.168.1.113] (account pcrews HELO [127.0.0.1])
	by cerious.com (CommuniGate Pro SMTP 4.1.8)
	with ESMTP id 10711896 for tiff@lists.maptools.org;
	Fri, 14 Nov 2008 17:13:11 -0500
Message-ID: <491DF80C.9010603@cerious.com>
Date: Fri, 14 Nov 2008 17:13:32 -0500
From: Phillip Crews <pcrews@cerious.com>
Organization: Cerious Software Inc.
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: tiff@lists.maptools.org
Subject: Re: [Tiff] Memory leak (TIFFOpen, TIFFReadTile)?
References: <200811142137.mAELb1jC000522@tux.cubewerx.com>
In-Reply-To: <200811142137.mAELb1jC000522@tux.cubewerx.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 081114-0, 11/14/2008), Outbound message
X-Antivirus-Status: Clean
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: 50 [XX]

Craig Bruce wrote:
> Frank Warmerdam <warmerdam@pobox.com> wrote:
>
>   
>> 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.
>>     
>
> I have found that memory-mapped I/O is completely FUBARed, even on Linux.
> Even if the kernel is ultimately going to release the memory, the system
> still thrashes like crazy.  It really shouldn't be the default mode
> for TIFFOpen().
>
> To avoid this problem, I call TIFFOpen() with a mode of "rCm".  This makes
> image reading work as expected.
>   
I use "rCm" for TIFF files above a certain (rather artbitrary) size -- 
80MB in my case -- for the same reason, but as long as memory is 
plentiful, memory mapped files are somewhat faster. I also used to use 
'rm' for smaller files on some Windows operating system (ME I think) 
because memory mapped files were left locked.

- Phillip

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