[Gdal-dev] Memory Leak in RasterIO?

lxnyce at bellsouth.net lxnyce at bellsouth.net
Mon Oct 20 12:23:33 EDT 2003


Has anyone else notice that every call to GDALRasterIO seems to be leaking memory with the latest and previous CVS versions of GDAL for a while now. I don't know about the official release. I have observed this using GeoTIFF and IMG files (the only ones I have tried). 

I came to the conclusion that the leak is in GDALRasterIO (or one of its sub-functions) because if I comment out that line alone, I get no memory leak. Everything else works as it should, just garbage values. I also notice that it occurs with or without the use of overviews. I have tried flushing the cache for every band, and still nothing. When I check the size of the block cache, its the default, ~5Megs.

Its pretty serious, because after roaming an image for a few iterations, the memory starts climbing. I reach 50megs worth of leaks just within a minute (according to windows task manager physical/virtual memory). The problem is not in my app, I am almost 100% certain of this, but inside that function. 

Is this a known issue? Can anyone point me in the right direction as to whats going on to leak so much memory? Are there any workarounds?





More information about the Gdal-dev mailing list