Thanks Even I'll upgrade and check back on the leaks<br><br>Sanjay<br><br><b><i>Even Rouault &lt;even.rouault@mines-paris.org&gt;</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&nbsp;:<br>&gt; Hi Martin,<br>&gt;               I did try calling all the below cleanup calls:<br>&gt;<br>&gt; VSICleanupFileManager();<br>&gt; GDALDestroyDriverManager();<br>&gt; CPLCleanupTLS();<br>&gt; CPLFinderClean();<br>&gt; CPLFreeConfig();<br>&gt;<br>&gt; But i  still have the leak with call stack
 showing the below order(poiting<br>&gt; to VSIMalloc):<br>&gt;<br>&gt; Type    Quantity    Total (bytes)    Allocation Location    Sequence<br>&gt;<br>&gt; Leak exiting program    1    4    gdal14.dll, cpl_vsisimple.cpp, VSIMalloc<br>&gt; - line 280    52 Memory Leak Exiting Program: Address 0x04266CF8 (4)<br>&gt; allocated by malloc.<br>&gt;<br>&gt; Allocation Call Stack - Thread 0 [0x0CA0]<br>&gt; VSIMalloc    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_vsisimple.cpp    280<br>&gt; CPLMalloc    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_conv.cpp    127<br>&gt; GTiffCreate    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gtiff\geotiff.cpp    3568<br>&gt; Create    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gtiff\geotiff.cpp    3640<br>&gt; Create    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldriver.cpp   
 109<br>&gt;<br>&gt; and the resource leaks are(one of the mutex) looks like:<br>&gt;<br>&gt; Type    Quantity    Deallocator    Allocation Location    Sequence<br>&gt;<br>&gt; CreateMutexA    1    CloseHandle    gdal14.dll, cpl_multiproc.cpp,<br>&gt; CPLCreateMutex - line 457    53 Resource Leak Exiting Program: Handle<br>&gt; 0x00000110 allocated by CreateMutexA.<br>&gt;<br>&gt; Allocation Call Stack - Thread 0 [0x0CA0]<br>&gt; CPLCreateMutex    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp    457<br>&gt; CPLCreateOrAcquireMutex    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp    117<br>&gt; CPLMutexHolder    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp    63<br>&gt; GetGDALDriverManager    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldrivermanager.cpp   <br>&gt; 72 GDALAllRegister    c:\documents
 and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\frmts\gdalallregister.cpp    73<br>&gt;<br>&gt; And TLSAlloc leak looks like:<br>&gt;<br>&gt; Type    Quantity    Deallocator    Allocation Location    Sequence<br>&gt;<br>&gt; TlsAlloc    1    TlsFree    gdal14.dll, cpl_multiproc.cpp, CPLGetTLSList -<br>&gt; line 642    58 Resource Leak Exiting Program: Handle 0x00000021 allocated<br>&gt; by TlsAlloc.<br>&gt;<br>&gt; Allocation Call Stack - Thread 0 [0x0CA0]<br>&gt; CPLGetTLSList    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp    642<br>&gt; CPLGetTLS    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_multiproc.cpp    954<br>&gt; CPLGetStaticResult    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_path.cpp    55<br>&gt; CPLGetDirname    c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\port\cpl_path.cpp    165<br>&gt; AutoLoadDrivers   
 c:\documents and<br>&gt; settings\sboddhu\desktop\gdal142\gdal-1.4.2\gcore\gdaldrivermanager.cpp   <br>&gt; 553<br>&gt;<br>&gt; Sorry to dump the call stack..but if martin/someone can find any obvious<br>&gt; mistake/ missing something in my calling the cleanup calls that would be<br>&gt; helpful.<br>&gt;<br>&gt; Thanks<br>&gt; Sanjay<br>&gt;<br>&gt; mchapman@texelinc.com wrote: Not sure if this is it but are you calling<br>&gt; GDALCleanupAll?  It's called that or GDALAllCleanup or something.  I think<br>&gt; it is declared near GDALRegisterAll.<br>&gt;<br>&gt; Martin<br>&gt;<br>&gt; Sent via BlackBerry by AT&amp;T<br>&gt;<br>&gt; -----Original Message-----<br>&gt; From: sanjay boddhu<br>&gt;<br>&gt; Date: Thu, 24 Jan 2008 01:41:45<br>&gt; To:gdal-dev@lists.osgeo.org<br>&gt; Subject: [gdal-dev] General Memory/Resource leak fixes(Cleanup calls)<br>&gt;<br>&gt;<br>&gt; Hi ,<br>&gt;      I have been trying to fix (or to be more appropriate, find the cleanup<br>&gt; calls to
 fix) the memory and resource leaks in my application(which uses<br>&gt; GDAL to read and write to a tif file). I have tried all the cleanup calls<br>&gt; mentioned in the end of :<br>&gt;<br>&gt; http://www.gdal.org/gdalinfo.c.html<br>&gt;<br>&gt; and reduced lot of memory/resource leaks......But i still get a memory leak<br>&gt; pointing in "GDALDataset  Create( ...)"  and few resource leaks of Mutex<br>&gt; and TLsAlloc.<br>&gt;<br>&gt; I would really appreciate if anyone can recommend the right cleanup calls<br>&gt; for the above leaks or hint me in the right direction.<br>&gt;<br>&gt; Thanks<br>&gt;<br>&gt; Sanjay<br>&gt;<br>&gt;<br>&gt;<br>&gt; "If you look at what you do not have in life, you don't have anything"<br>&gt; "If you look at what you have in life, you have everything"<br>&gt;<br>&gt; ----------------<br>&gt; Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it<br>&gt; now.  _______________________________________________ gdal-dev
 mailing list<br>&gt; gdal-dev@lists.osgeo.org<br>&gt; http://lists.osgeo.org/mailman/listinfo/gdal-dev<br>&gt;<br>&gt;<br>&gt;<br>&gt; "If you look at what you do not have in life, you don't have anything"<br>&gt; "If you look at what you have in life, you have everything"<br>&gt;<br>&gt; ---------------------------------<br>&gt; 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>&#32;
      <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>