[gdal-dev] Java bindings to gdal/ogr - looking for more developer documentation

Even Rouault even.rouault at spatialys.com
Thu May 29 10:05:05 PDT 2025


Hi,
>
> In particular I would like to know more about object life cycles and 
> memory management:
> What kind of object management is the client program responsible for?

Normally none, but you may want to explicitly call .Close() on datasets 
to ensure the underlying file is closed at the appropriate moment

> Do I need to close objects manually or will the garbage collector take 
> care of this for me?
for objects other than datasets, GC should work fine
> If I open an OGR Dataset twice will I get two separate instances, or 
> will the reference be shared?
unless you call Dataset.OpenEx() with the GDAL_OF_SHARED flag set, 
you'll get separate instances. And be careful if using shared instances: 
you cannot use them concurrently from different threads. If you work 
with separate instances, (for read-only operations) that should be fine.
>
> Is this mailing list the place where I should be asking these 
> questions, or it there a better place for it?

No, that's fine

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250529/f34a8594/attachment.htm>


More information about the gdal-dev mailing list