gdal-warp-bindings icon indicating copy to clipboard operation
gdal-warp-bindings copied to clipboard

Information and control over memory use

Open jdries opened this issue 2 years ago • 2 comments

I'm trying to get more insight into memory use by GDAL:

  • access to https://gdal.org/api/raster_c_api.html#_CPPv416GDALGetCacheUsedv
  • closing datasets, would probably require PR?

For things like getting cache usage, I'm wondering if this can or should be done via standard binding?

jdries avatar Mar 21 '24 15:03 jdries

Hello,

Thanks so much for your interest. I am the author of the code in question (management of datasets), though @pomadchin may wish to chime in, as well. My understanding of the second half of your query is "is it possible for me to forcibly close open GDAL datasets"? It is not possible to do so selectively (to the best of my memory!), but you can use clear to close all of the datasets associated with the gdal-warp-bindings cache, which should in turn release GDAL resources. A more selective approach would indeed need a PR.

jamesmcclain avatar Mar 28 '24 22:03 jamesmcclain

:hmm: I think clear is not exposed via Java API 🤔 we could expose it. Dangerously can be used probably.

pomadchin avatar Mar 28 '24 23:03 pomadchin