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 to VSIMalloc):<br><br>T<span style="font-style: italic;">ype Quantity Total (bytes) Allocation Location Sequence</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">Leak exiting program 1 4 gdal14.dll, cpl_vsisimple.cpp, VSIMalloc - line 280 52</span><br style="font-style: italic;"><span style="font-style: italic;"> Memory Leak Exiting Program: Address 0x04266CF8 (4) allocated by malloc.</span><br style="font-style: italic;"><br
style="font-style: italic;"><span style="font-style: italic;">Allocation Call Stack - Thread 0 [0x0CA0]</span><br style="font-style: italic;"><span style="font-style: italic;">VSIMalloc c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_vsisimple.cpp 280</span><br style="font-style: italic;"><span style="font-style: italic;">CPLMalloc c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_conv.cpp 127</span><br style="font-style: italic;"><span style="font-style: italic;">GTiffCreate c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gtiff\geotiff.cpp 3568</span><br style="font-style: italic;"><span style="font-style: italic;">Create c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gtiff\geotiff.cpp 3640</span><br style="font-style: italic;"><span
style="font-style: italic;">Create c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldriver.cpp 109</span><br><br>and the resource leaks are(one of the mutex) looks like:<br><br>T<span style="font-style: italic;">ype Quantity Deallocator Allocation Location Sequence</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">CreateMutexA 1 CloseHandle gdal14.dll, cpl_multiproc.cpp, CPLCreateMutex - line 457 53</span><br style="font-style: italic;"><span style="font-style: italic;"> Resource Leak Exiting Program: Handle 0x00000110 allocated by CreateMutexA.</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">Allocation Call Stack - Thread 0 [0x0CA0]</span><br
style="font-style: italic;"><span style="font-style: italic;">CPLCreateMutex c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 457</span><br style="font-style: italic;"><span style="font-style: italic;">CPLCreateOrAcquireMutex c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 117</span><br style="font-style: italic;"><span style="font-style: italic;">CPLMutexHolder c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 63</span><br style="font-style: italic;"><span style="font-style: italic;">GetGDALDriverManager c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldrivermanager.cpp 72</span><br style="font-style: italic;"><span style="font-style: italic;">GDALAllRegister c:\documents and
settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gdalallregister.cpp 73<br><br></span>And TLSAlloc leak looks like:<span style="font-style: italic;"><br><br><span style="font-style: italic;">Type Quantity Deallocator Allocation Location Sequence<br><br>TlsAlloc 1 TlsFree gdal14.dll, cpl_multiproc.cpp, CPLGetTLSList - line 642 58<br> Resource Leak Exiting Program: Handle 0x00000021 allocated by TlsAlloc.<br><br>Allocation Call Stack - Thread 0 [0x0CA0]<br>CPLGetTLSList c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 642<br>CPLGetTLS c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp 954<br>CPLGetStaticResult c:\documents and
settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_path.cpp 55<br>CPLGetDirname c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_path.cpp 165<br>AutoLoadDrivers c:\documents and settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldrivermanager.cpp 553<br></span></span><br>Sorry to dump the call stack..but if martin/someone can find any obvious mistake/ missing something in my calling the cleanup calls that would be helpful.<br><br>Thanks<br>Sanjay<br><br><b><i>mchapman@texelinc.com</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Not sure if this is it but are you calling GDALCleanupAll? It's called that or GDALAllCleanup or something. I think it is declared near GDALRegisterAll. <br><br>Martin<br><br>Sent via BlackBerry by AT&T<br><br>-----Original Message-----<br>From:
sanjay boddhu <sanjay_ieee@yahoo.com><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 calls to fix) the memory and resource leaks in my application(which uses GDAL to read and write to a tif file). I have tried all the cleanup calls 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 pointing in "GDALDataset Create( ...)" and few resource leaks of Mutex and TLsAlloc. <br><br>I would really appreciate if anyone can recommend the right cleanup calls 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 now. <http: us.rd.yahoo.com="" evt="51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ"> _______________________________________________<br>gdal-dev mailing list<br>gdal-dev@lists.osgeo.org<br>http://lists.osgeo.org/mailman/listinfo/gdal-dev<br></http:></sanjay_ieee@yahoo.com></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>Never miss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>