Le 18/09/2024 à 21:23, Larry Gritz via Tiff a écrit :
I noticed the relatively recent (in the grand scheme of things) addition of
TIFFOpenOptionsSetMaxSingleMemAlloc and TIFFOpenOptionsSetMaxCumulatedMemAlloc
to limit the allocations for a particular handle.
Is there any way to query libtiff about how much total memory it is currently
holding for the internal data structures of a single open TIFF handle? It seems
like this must already be tracked internally for the SetMax functions to be
effective, but as far as I can see, there is no way to query it.
No, you can't. Feel free to contribute an enhancement to do that.
Cf
https://gitlab.com/libtiff/libtiff/-/commit/f53258e4bbf22cf4c33aa2e31d3dd2c30801120e
.
What you need is the tiff::tif_cur_cumulated_mem_alloc member
An important note to add in the documentation of such a function is that
tif_cur_cumulated_mem_alloc is updated only if
TIFFOpenOptionsSetMaxCumulatedMemAlloc() has been called.
That would be really handy in situations where an application that may have
many files open seems to be using a lot of memory, and we'd want to try to
figure out if that memory is held by libtiff, and if so, which files seem to be
the ones with a large footprint.
--
Larry Gritz
[email protected]
_______________________________________________
Tiff mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/tiff
--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
Tiff mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/tiff