<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ming:<br>
<br>
I posted this several years ago:<br>
<br>
"I have been running the CBC MIP repetitively from CoinMP.dll and it
seems to be leaking memory and growing in size.
<br>
<br>
I have added a delete of the cbc object into CoinMP.cpp as follows. It
looks like this will also delete the cut generator objects created as
its destructor includes deletion of the cut generators.
<br>
<br>
SOLVAPI int CoinUnloadProblem(HPROB hProb)
<br>
{
<br>
&nbsp; PCOIN pCoin = (PCOIN)hProb;
<br>
&nbsp; &nbsp;&nbsp; if (pCoin) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete pCoin-&gt;clp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pCoin-&gt;RowLower) free(pCoin-&gt;RowLower);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pCoin-&gt;RowUpper) free(pCoin-&gt;RowUpper);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pCoin-&gt;IsInt) free(pCoin-&gt;IsInt);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete pCoin-&gt;cbc;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pCoin-&gt;cbc = NULL;
<br>
&nbsp;&nbsp; }
<br>
&nbsp;&nbsp; free(pCoin);
<br>
&nbsp;&nbsp; pCoin = NULL;
<br>
&nbsp;&nbsp; return SOLV_SUCCESS;
<br>
}
<br>
<br>
"<br>
<br>
And I think Stuart Mitchell from NZ also raised a ticket about this.<br>
<br>
Rod<br>
<br>
ming lu wrote:
<blockquote
 cite="mid:444a4cee0910130759j7c1cd226he370aedb73269c12@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">Hi All,

It looks that CoinUnloadProblem doesn't release resource correctly.
The cbc was not released, this causes a huge memory leak problem. Also
following members are not explicitly released:

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ClpSolve *clp_presolve;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OsiClpSolverInterface *osi;
                               CBMessageHandler *msghandler;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CBIterHandler *iterhandler;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CBNodeHandler *nodehandler;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CglProbing *probing;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CglGomory *gomory;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CglKnapsackCover *knapsack;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CglOddHole *oddhole;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CglClique *clique;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CglLiftAndProject *liftpro;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CglSimpleRounding *rounding;

Could someone take a look?

Thanks,
Ming

    </pre>
  </blockquote>
  <pre wrap=""><!---->

_______________________________________________
CoinMp mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CoinMp@list.coin-or.org">CoinMp@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="http://list.coin-or.org/mailman/listinfo/coinmp">http://list.coin-or.org/mailman/listinfo/coinmp</a>

  </pre>
</blockquote>
</body>
</html>