AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.11.14 08:29 "Memory leak (TIFFOpen, TIFFReadTile)?", by Ilkka Korpela
2008.11.14 17:49 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Bob Friesenhahn
2008.11.14 18:37 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Ilkka Korpela
2008.11.14 19:11 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Frank Warmerdam
2008.11.14 21:37 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Craig Bruce
2008.11.14 22:13 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Phillip Crews
2008.11.14 23:31 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Bob Friesenhahn
2008.11.15 17:07 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Craig Bruce
2008.11.17 16:33 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Bob Friesenhahn
2008.11.17 17:20 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Frank Warmerdam
2008.11.17 17:39 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Bob Friesenhahn
2008.11.19 20:09 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Frank Warmerdam
2008.11.19 20:21 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Craig Bruce
2008.11.19 20:47 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Edward Lam
2008.11.19 21:09 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Craig Bruce
2008.11.19 20:56 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Andy Cave
2008.11.20 04:17 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by <ron@debian.org>
2008.11.20 04:47 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Bob Friesenhahn
2008.11.20 08:17 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by <jcupitt@gmail.com>
2008.11.17 21:44 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by <jcupitt@gmail.com>
2008.11.17 22:22 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Bob Friesenhahn
2008.11.17 22:47 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by <jcupitt@gmail.com>
2008.11.14 22:03 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by Phillip Crews

2008.11.17 21:44 "Re: Memory leak (TIFFOpen, TIFFReadTile)?", by <jcupitt@gmail.com>

2008/11/17 Frank Warmerdam <warmerdam@pobox.com>:
>> 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().
>
> I am interested in advice on whether to change TIFFOpen() to *not* use
> memory mapped IO by default.

I tried a couple of benchmarks:

1) Sequential read of a large file

I made a 1.8 gb RGB 8-bit tiff in strips and read it in order. I got
about 60s real time, 12s user, 5s sys for both read() and mmap().
There was quite a lot of variability between runs, but no clear
winner.

Watching progress in "top", you could see that the read() version had
a steady and low RSS, whereas the mmap() one slowly crept up to 1.8 gb
as the operation ran. However,  resident shared pages are counted in
RSS, so this wasn't a "real" 1.8 gb process, it was just showing (in
effect) the system disc cache as part of the process size. The read()
version will have just as dramatic effect on the state of memory, as
the system tries to cache all the pages it passes to read(). I think
the two versions are equivalent in terms of memory use.

2) Random read of a large file

I made a 250 mb tiled RGB 8-bit tiff and rotated it 90 degrees. I had
thought that the heavy seeking would favour mmap(), but again they
seem to have almost identical performance. Both versions ran in about
10s real, 3s user, 1s sys.

Again, although they look very different to "top", I think they are
equivalent in terms of mem use as well.

To summarise, I'm a bit surprised as I thought that mmap did have some
performance advantages. It certainly did 15 years ago, or whenever it
was that we were all so excited about it. I guess read() has become a
lot better. But I'm not sure that mmap() has any real disadvantages
either, at least in this case (local disc). I didn't try a networked
device.

John