2008.10.14 18:00 "[Tiff] debugging on Windows", by Rajmohan Banavi

2008.11.14 22:13 "Re: [Tiff] Memory leak (TIFFOpen, TIFFReadTile)?", by Phillip Crews

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