Thanks Even I'll upgrade and check back on the leaks<br><br>Sanjay<br><br><b><i>Even Rouault <even.rouault@mines-paris.org></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> The leak reported in geotiff.cpp was indeed a leak in GDAL 1.4.2. It's fixed <br>since GDAL 1.5.0, so you should consider upgrading.<br><br>As far the ressource leaks, I can't really say as it's probably windows <br>specific stuff I can't test on my platform, but I wouldn't worry too much if <br>I were you. These are probably just one time leaks.<br><br>Le Thursday 24 January 2008 20:44:08 sanjay boddhu, vous avez écrit :<br>> Hi Martin,<br>> I did try calling all the below cleanup calls:<br>><br>> VSICleanupFileManager();<br>> GDALDestroyDriverManager();<br>> CPLCleanupTLS();<br>> CPLFinderClean();<br>> CPLFreeConfig();<br>><br>> But i still have the leak with call stack
showing the below order(poiting<br>> to VSIMalloc):<br>><br>> Type Quantity Total (bytes) Allocation Location Sequence<br>><br>> Leak exiting program 1 4 gdal14.dll, cpl_vsisimple.cpp, VSIMalloc<br>> - line 280 52 Memory Leak Exiting Program: Address 0x04266CF8 (4)<br>> allocated by malloc.<br>><br>> Allocation Call Stack - Thread 0 [0x0CA0]<br>> VSIMalloc c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_vsisimple.cpp 280<br>> CPLMalloc c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_conv.cpp 127<br>> GTiffCreate c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gtiff\geotiff.cpp 3568<br>> Create c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gtiff\geotiff.cpp 3640<br>> Create c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldriver.cpp
109<br>><br>> and the resource leaks are(one of the mutex) looks like:<br>><br>> Type Quantity Deallocator Allocation Location Sequence<br>><br>> CreateMutexA 1 CloseHandle gdal14.dll, cpl_multiproc.cpp,<br>> CPLCreateMutex - line 457 53 Resource Leak Exiting Program: Handle<br>> 0x00000110 allocated by CreateMutexA.<br>><br>> Allocation Call Stack - Thread 0 [0x0CA0]<br>> CPLCreateMutex c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 457<br>> CPLCreateOrAcquireMutex c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 117<br>> CPLMutexHolder c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 63<br>> GetGDALDriverManager c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldrivermanager.cpp <br>> 72 GDALAllRegister c:\documents
and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gdalallregister.cpp 73<br>><br>> And TLSAlloc leak looks like:<br>><br>> Type Quantity Deallocator Allocation Location Sequence<br>><br>> TlsAlloc 1 TlsFree gdal14.dll, cpl_multiproc.cpp, CPLGetTLSList -<br>> line 642 58 Resource Leak Exiting Program: Handle 0x00000021 allocated<br>> by TlsAlloc.<br>><br>> Allocation Call Stack - Thread 0 [0x0CA0]<br>> CPLGetTLSList c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 642<br>> CPLGetTLS c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 954<br>> CPLGetStaticResult c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_path.cpp 55<br>> CPLGetDirname c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_path.cpp 165<br>> AutoLoadDrivers
c:\documents and<br>> settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldrivermanager.cpp <br>> 553<br>><br>> Sorry to dump the call stack..but if martin/someone can find any obvious<br>> mistake/ missing something in my calling the cleanup calls that would be<br>> helpful.<br>><br>> Thanks<br>> Sanjay<br>><br>> mchapman@texelinc.com wrote: Not sure if this is it but are you calling<br>> GDALCleanupAll? It's called that or GDALAllCleanup or something. I think<br>> it is declared near GDALRegisterAll.<br>><br>> Martin<br>><br>> Sent via BlackBerry by AT&T<br>><br>> -----Original Message-----<br>> From: sanjay boddhu<br>><br>> Date: Thu, 24 Jan 2008 01:41:45<br>> To:gdal-dev@lists.osgeo.org<br>> Subject: [gdal-dev] General Memory/Resource leak fixes(Cleanup calls)<br>><br>><br>> Hi ,<br>> I have been trying to fix (or to be more appropriate, find the cleanup<br>> calls to
fix) the memory and resource leaks in my application(which uses<br>> GDAL to read and write to a tif file). I have tried all the cleanup calls<br>> mentioned in the end of :<br>><br>> http://www.gdal.org/gdalinfo.c.html<br>><br>> and reduced lot of memory/resource leaks......But i still get a memory leak<br>> pointing in "GDALDataset Create( ...)" and few resource leaks of Mutex<br>> and TLsAlloc.<br>><br>> I would really appreciate if anyone can recommend the right cleanup calls<br>> for the above leaks or hint me in the right direction.<br>><br>> Thanks<br>><br>> Sanjay<br>><br>><br>><br>> "If you look at what you do not have in life, you don't have anything"<br>> "If you look at what you have in life, you have everything"<br>><br>> ----------------<br>> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it<br>> now. _______________________________________________ gdal-dev
mailing list<br>> gdal-dev@lists.osgeo.org<br>> http://lists.osgeo.org/mailman/listinfo/gdal-dev<br>><br>><br>><br>> "If you look at what you do not have in life, you don't have anything"<br>> "If you look at what you have in life, you have everything"<br>><br>> ---------------------------------<br>> Never miss a thing. Make Yahoo your homepage.<br><br><br></blockquote><br><BR><BR>"If you look at what you do not have in life, you don't have anything"<br>"If you look at what you have in life, you have everything"<p> 
<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>