-----Original Message-----
From: Frank Warmerdam [mailto:warmer...@pobox.com] 
Sent: Thursday, July 29, 2010 4:35 PM
To: Kevin F Webb
Cc: gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] Memory leak from GDALRasterIO

Kevin F Webb wrote: 
> 
> I am experiencing a memory leak from looped calls to GDALRasterIO(). It 
> may be something I am doing improperly
> because I use/call RasterIO() in a C++ program that runs leak free.
> 

Kevin,

You haven't shown your code, but I suspect you aren't closing the
datasource and so the block cache isn't getting cleaned up.


I misrepresented this issue as a "Memory Leak." There was no leak, all resources
were in fact being recovered by GDALClose(). What I did experience was resource 
allocation during each loop on GDALRasterIO() such that it appeared that the 
heap 
was exhausted. 

With some off-list help from Frank, he directed me to the API calls for 
GDALFlushCacheBlock(), and GDALSetCacheMax() which have solved my problem.

Thank you Frank!


KFW
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to