<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Your patch was committed to trunk, backported to 1.11 and 1.10. Ticked #5590 close.<br><br>Please verify.<br><br>Regards,<br><br>Ivan<br><br><div><hr id="stopSpelling">From: nicolas.simon@spw.wallonie.be<br>To: gdal-dev@lists.osgeo.org<br>Date: Fri, 1 Aug 2014 14:49:35 +0000<br>Subject: Re: [gdal-dev] OGR: memory leak in OCI driver<br><br>



<style><!--
.ExternalClass .ecxshape {
}
--></style><style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink {
color:blue;
text-decoration:underline;
}

.ExternalClass span.ecxMsoHyperlinkFollowed {
color:purple;
text-decoration:underline;
}

.ExternalClass p {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

.ExternalClass tt {
font-family:"Courier New";
}

.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate {
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
}

.ExternalClass p.ecxmsonormal, .ExternalClass li.ecxmsonormal, .ExternalClass div.ecxmsonormal {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

.ExternalClass span.ecxmsohyperlink {
}

.ExternalClass span.ecxmsohyperlinkfollowed {
}

.ExternalClass span.ecxemailstyle17 {
}

.ExternalClass p.ecxmsonormal1, .ExternalClass li.ecxmsonormal1, .ExternalClass div.ecxmsonormal1 {
font-size:11.0pt;
font-family:"Calibri","sans-serif";
}

.ExternalClass span.ecxmsohyperlink1 {
color:blue;
text-decoration:underline;
}

.ExternalClass span.ecxmsohyperlinkfollowed1 {
color:purple;
text-decoration:underline;
}

.ExternalClass span.ecxemailstyle171 {
font-family:"Calibri","sans-serif";
color:windowtext;
}

.ExternalClass span.ecxTextedebullesCar {
font-family:"Tahoma","sans-serif";
}

.ExternalClass span.ecxEmailStyle29 {
font-family:"Calibri","sans-serif";
color:#1F497D;
}

.ExternalClass .ecxMsoChpDefault {
font-size:10.0pt;
}

.ExternalClass div.ecxWordSection1 {
}

--></style>


<div class="ecxWordSection1">
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Hi list,</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">                We tested the suggestion of Ivan and it’s better.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">                Fortunately, my problem to create ticket was solved
</span></p>
<p class="ecxMsoNormal" style="text-indent:35.4pt;"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">The ticket is  <a href="http://trac.osgeo.org/gdal/ticket/5599" target="_blank">http://trac.osgeo.org/gdal/ticket/5599</a> with a patch file.</span></p>
<p class="ecxMsoNormal" style="text-indent:35.4pt;"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal" style="text-indent:35.4pt;"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Best regards</span></p>
<p class="ecxMsoNormal" style="text-indent:35.4pt;"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Nicolas</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm;">
<p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";" lang="FR">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";" lang="FR"> Ivan Lucena [mailto:lucena_ivan@hotmail.com]
<br>
<b>Envoyé :</b> mardi 6 mai 2014 17:48<br>
<b>À :</b> SIMON Nicolas; gdal-dev@lists.osgeo.org<br>
<b>Cc :</b> SANDRI Christophe; NGUYEN Thi Xuan Truc<br>
<b>Objet :</b> RE: [gdal-dev] OGR: memory leak in OCI driver</span></p>
</div>
</div>
<p class="ecxMsoNormal"> </p>
<div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";">Hi Nicolas,<br>
<br>
I received that report a month ago:<br>
<br>
"we have found the OGROCISession is never released, causing a large memory leak whenever a connection is closed.
<br>
As workaround, we added in O</span><tt><span style="font-size:10.0pt;">GROCISession::~OGROCISession()</span></tt><span style="font-family:"Calibri","sans-serif";"><br>
<br>
</span><tt><span style="font-size:10.0pt;">    if( hEnv )</span></tt><span style="font-size:10.0pt;font-family:"Courier New";"><br>
<tt>           OCIHandleFree((dvoid *) hEnv, (ub4) OCI_HTYPE_ENV);</tt></span><span style="font-family:"Calibri","sans-serif";">"<br>
<br>
But they also mention some other memory leaks without an specific location on the code.<br>
<br>
Can you try to see if that fix the problem?<br>
<br>
Thanks,<br>
<br>
Ivan<br>
<br>
</span></p>
<div>
<div class="ecxMsoNormal" style="text-align:center;" align="center"><span style="font-family:"Calibri","sans-serif";">
<hr id="ecxstopSpelling" align="center" size="2" width="100%">
</span></div>
<p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";">From:
<a href="mailto:nicolas.simon@spw.wallonie.be">nicolas.simon@spw.wallonie.be</a><br>
To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
Date: Tue, 6 May 2014 15:32:09 +0000<br>
CC: <a href="mailto:christophe.sandri@spw.wallonie.be">christophe.sandri@spw.wallonie.be</a>;
<a href="mailto:xuan.nguyen@spw.wallonie.be">xuan.nguyen@spw.wallonie.be</a><br>
Subject: [gdal-dev] OGR: memory leak in OCI driver</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">Dear developers,</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">                I suspect that there is a memory leak in OCI driver for OGR</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">               
</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">                My simplified test case is :</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">…          
</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">// point A</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">OGRRegisterAll();</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">// point B</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">pDS = OGRSFDriverRegistrar::Open("OCI:USER/PWD@INSTANCE:TABLE", true);</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">if(pDS)</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">     {</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">          OGRDataSource::DestroyDataSource(pDS);</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">          pDS = NULL;</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">     }</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">     else</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">     {</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">          fprintf(fOut,"Erreur Open\n");</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">     }</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">     // point C</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">     </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">OGRCleanupAll();</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">// point D</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">It appears that I lose memory between points B and C, and between point A and D  
</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">                B = A + 4 MB</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">                C = A + 20 MB ( 16 MB lost)</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">               D = A +19 MB ( 3 more MB lost)
</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">Test was done with GDAL 1.9 under windows (with Oracle 11g)</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">Can some one have an idea to find and fix this ?</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">Thank you</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">By the way,  I received « TICKET_CREATE privileges are required to perform this operation » when I tried to make a ticket (UID nicsim)</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">Nicolas</span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"> </span></p>
</div>
<p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";"><br>
_______________________________________________ gdal-dev mailing list <a href="mailto:gdal-dev@lists.osgeo.org">
gdal-dev@lists.osgeo.org</a> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">
http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></span></p>
</div>
</div>
</div>


<br>_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev</div>                                      </div></body>
</html>