<html><body>
<p>Thanks - patch will go in.<br>
<br>
<img width="16" height="16" src="cid:1__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for Renaud Lepere ---09/15/2009 10:17:19 AM---Hello, I am using OSI/CLP to solve a lot of linear program"><font color="#424282">Renaud Lepere ---09/15/2009 10:17:19 AM---Hello, I am using OSI/CLP to solve a lot of linear programs, some of them</font><br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">From:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">Renaud Lepere <Renaud.Lepere@alma.fr></font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">To:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">"osi@list.coin-or.org" <osi@list.coin-or.org></font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Date:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">09/15/2009 10:17 AM</font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Subject:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">[Osi] memory leaks in OSI/CLP</font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Sent by:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCA7DFB0D9ED8f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">osi-bounces@list.coin-or.org</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><br>
Hello,<br>
<br>
I am using OSI/CLP to solve a lot of linear programs, some of them <br>
are impossible, but i have found some memory leaks on some problems.<br>
I have instrumented my code to produce a standalone program that <br>
reproduce the leak, apparently the leak is within Clp code.<br>
I have gone a bit further i think leak.patch should solve the <br>
problem. <br>
<br>
Renaud,<br>
<br>
<br>
Roughly my code is something like :<br>
void test_xx() {<br>
                 OsiSolverInterface * solver(new OsiClpSolverInterface());<br>
                 solver->reset();<br>
<br>
                 solver->addCol(0, 0, 0, lb1, ub1, obj1);<br>
                 ... <br>
                 solver->addRow(...);<br>
<br>
                 solver->initialSolve();<br>
delete solver;<br>
}<br>
<br>
The complete and standalone program is test_osi.cpp with includes<br>
osi_16_9433435.inl, this file is a sort of log of the call i'm <br>
doing to osi (double values are encoded exactly using long long).<br>
<br>
test_osi.cpp contains also a small memory leak detector. The output<br>
of the program on <br>
<br>
Clp0024I Matrix will be packed to eliminate 307 small elements<br>
Coin0506I Presolve 892 (-770) rows, 228 (-88) columns and 1784 (-1161) elements<br>
Clp0009I 1 infeasibilities<br>
Clp3003W Analysis indicates model infeasible or unbounded<br>
Clp0006I 0 Obj 9726.95 Primal inf 203.146 (9)<br>
Clp0006I 27 Obj 9738.14 Primal inf 168.766 (27)<br>
Clp0001I Primal infeasible - objective value 9738.14<br>
Clp0032I PrimalInfeasible objective 9738.139668 - 27 iterations time 0.082<br>
Clp0006I 0 Obj 9738.14 Primal inf 168.766 (27)<br>
Clp0006I 4 Obj 9738.14 Primal inf 185.375 (37)<br>
Clp0001I Primal infeasible - objective value 9738.14<br>
nbLeak: 43, nbAlloc: 21072<br>
<br>
Using mmgr i located more precisely the leak, here is the call stack<br>
>                 test_osid.exe!ClpPresolve::gutsOfPresolvedModel(ClpSimplex * originalModel=0x0032b850, double feasibilityTolerance=1.0000000000000000e-008, bool keepIntegers=false, int numberPasses=5, bool dropNames=true, bool doRowObjective=false) Ligne 1521 + 0xa octets                 C++<br>
                 test_osid.exe!ClpPresolve::presolvedModel(ClpSimplex & si={...}, double feasibilityTolerance=1.0000000000000000e-008, bool keepIntegers=false, int numberPasses=5, bool dropNames=true, bool doRowObjective=false) Ligne 105                 C++<br>
                 test_osid.exe!ClpSimplex::initialSolve(ClpSolve & options={...}) Ligne 485 + 0x33 octets                 C++<br>
                 test_osid.exe!OsiClpSolverInterface::initialSolve() Ligne 694                 C++<br>
<br>
Apparently the memory is lost when model2 = this; line 906 in clpsolve.cpp <br>
i just added delete model2 line to fix the problem. <br>
handler_->message(CLP_INFEASIBLE,messages_) <<CoinMessageEol;<br>
-> delete model2; <br>
model2 = this; <br>
<br>
[attachment "leak.patch" deleted by John J Forrest/Watson/IBM] [attachment "osi_16_9433435.inl.gz" deleted by John J Forrest/Watson/IBM] [attachment "test_osi.cpp" deleted by John J Forrest/Watson/IBM] _______________________________________________<br>
Osi mailing list<br>
Osi@list.coin-or.org<br>
</tt><tt><a href="http://list.coin-or.org/mailman/listinfo/osi">http://list.coin-or.org/mailman/listinfo/osi</a></tt><tt><br>
</tt><br>
<br>
</body></html>