[gdal-dev] RE: Memory leak from GDALRasterIO

Frank Warmerdam warmerdam at pobox.com
Thu Oct 28 13:12:43 EDT 2010


BradC wrote:
> Hi All,
> 
> I am working on fixing a memory use issue in the Virtual Planet Builder
> project (an off shoot of OpenSceneGraph) and have come accross the exact
> issue described in this thread.
> 
> The code essential runs in a loop creating an image pyramid from a large ECW
> file. During this loop there a very large number of RasterIO() calls. When
> doing this memory use grows continually, seemingly without limit. If I close
> and repoen my GDALDataSet regulary then I regain all the memory but it seems
> from  this thread there should be a much better way to control memory use.
> 
> I have tried calling GDALSetCacheMax() with values from 1 to 1,000,000 with
> no effect. I have also tried calling while(GDALFlushCacheBlock()); after
> each RasterIO call, once again with no effect.
> 
> I am hoping somebody could point me in the right direction because I am
> running out of ideas.

Brad,

I *think* this is due to aggressive caching logic within the ECW SDK itself
and I'm not aware of how to influence it as an application built on the SDK.
You might want to poke around on the ECW Forums for clues.

Best regards,
-- 
---------------------------------------+--------------------------------------
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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list