[gdal-dev] Excessive memory usage in python script

Frank Warmerdam warmerdam at pobox.com
Mon Jun 9 15:34:48 EDT 2008


>   format = "GTiff"
>   outdataset.driver.Create(outfile, inband.XSize, inband.YSize, 1, 
> gdal.GDT_Float32)
>   outband = outdataset.GetRasterBand(1)

Jamie,

I'm very suspicious about the above, and I *suspect* it is orphaning
the new dataset objects created with the Create() call which might
be responsible for your resource leak.

I would suggest:

   format = "GTiff"
   outdataset = gdal.GetDriverByName(format).Create(....)

Good luck,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list