gene wrote:
Good day everyone :)

I am a new OGR user,  using S57 driver to read ENC chart data. It
appears that I am having a serious issue with memory not being freed as
expected. I.e. - I create and initialize an S57Reader (pretty much
following the example from the source tree), read features, do a bit of
work (work includes using Clone() method to clone some of the features),
and then delete all features (using the provided Destroy method for
safety sake). At this point, it appears that there are still multiple
objects on the heap that were allocated by OGR at some point. They seem
to be in direct proportion to the number of features used. I am using
MacOS and malloc_history shows a number of different items as being
still allocated, this is also supported by memory size (both RSIZE and
VSIZE) going up as features are allocated and never decreasing much.

Is there anything I am overlooking in the way I use the driver or the
feature data? The issue seems to be too obvious to be an actual problem
with the library.

Gene,

Is there any particular reason you are using the S57Reader directly
instead of using it through OGR?

I have run valgrind, a memory leak tester, against an ogrinfo dump
of all the features in an S57 dataset and there were no apparent
leaks.  So I imagine if you are seeing a leak, it is likely due
to failure to free something at the application level.

If you want more feedback you should provide a simplified example
of your code that suffers the leakage.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [email protected]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to