[gdal-dev] severe memory leak when opening corrupt modis hdf (python bindings)

Vincent Schut schut at sarvision.nl
Thu Oct 31 04:29:58 PDT 2013


Hi,

when opening a corrupt hdf4 modis product (I've put an example here: 
http://sarvision.nl/~schut/gdal_corrupt_hdf/MYD09GQ.A2010007.h11v09.005.2010010052202.hdf) 
with python, there is a severe memory leak (multiple GB!)

it is a dataset that gives "ERROR 4: 
`/data/modis/MOLA/MYD09GQ.005/2010.01.07/MYD09GQ.A2010007.h11v09.005.2010010052202.hdf' 
not recognised as a supported file format." when running gdalinfo on it. 
When opening it with python (gdal.Open('...'), the result is None, but 
there is a significant grow in memory usage that is only freed after 
exiting python.

Can someone confirm? Just repeatedly running ds = 
gdal.Open('MYD09GQ.A2010007.h11v09.005.2010010052202.hdf') should do it. 
Well, maybe not repeatedly. Running it once already gets my memory usage 
more than 2GB higher...

This is on gentoo linux, gdal from svn (updated yesterday), python 
2.7.5, hdf 4.2.9, and also tested on Arch Linux.

Can someone confirm?


Best regards,
Vincent.


More information about the gdal-dev mailing list