2016.01.25 18:25 "[Tiff] OpenMP enabled libtiff", by Aaron Boxer

2016.01.29 15:48 "Re: [Tiff] OpenMP enabled libtiff", by Aaron Boxer

On Fri, Jan 29, 2016 at 9:46 AM, Bob Friesenhahn < bfriesen@simple.dallas.tx.us> wrote:

Thanks. This is exactly the work flow I am interested in: tens of thousands of ~10 MB TIFFs, accessed sequentially.

suggesting I will see swapping in this case?

It would not be true swapping or paging-out (actually, there could be some paging out to swap), but there will be memory pressure since memory mapping behaves as a cache. The file data is still in memory (by default) after the file has been unmapped and memory pages are re-claimed (existing contents forgotten, and page re-purposed) for new activity based on new memory pressures, and the time the memory has remained inactive.

The actual behavior is highly OS implementation dependent.

On Unix type systems, the madvise() function can be used to help control behavior of memory-mapped data (e.g. MADV_DONTNEED), but again behavior is highly OS implementation dependent and the only way to know for sure is to test.

Thanks, Bob. On windows, since there is no madvise function, wouldn't reading a file and memory mapping the file both give the same result: the file gets cached in the OS file cache, causing memory pressure when the cache gets filled up?

Also, if madvise() is used on Unix, would that not degrade performance for TIFF reading, since libtiff uses some random access to file, and file would not be cached?

> Bob
> --
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer, http://www.GraphicsMagick.org/