[gdal-dev] memory leak in gdal program

Even Rouault even.rouault at spatialys.com
Fri Aug 21 10:51:39 PDT 2015


Le vendredi 21 août 2015 17:32:09, jramm a écrit :
> I'm using GDAL 201 to iterate features in a geodatabase feature class and
> add a new text field, whose value depends on the integer value in another
> field.It gives a fairly large memory leak (approx 1GB for every 1m
> features iterated). I'm not sure where the leak is....any ideas?

Hi,

Yes, 2 things to add at the end of the loop:
- OGR_L_SetFeature(hLayer, hFeature) to actually update the feature
- OGR_F_Destroy(hFeature) to free the memory taken by the feature (will fix the 
memory leak)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list