[Osi-tickets] [COIN-OR Open Solver Interface] #52: Memory leak in ClpSimplex, Osi 0.97.0 rev. 193

COIN-OR Open Solver Interface coin-trac at coin-or.org
Tue Apr 1 10:10:39 EDT 2008


#52: Memory leak in ClpSimplex, Osi 0.97.0 rev. 193
---------------------------------------------------------------+------------
 Reporter:  stoinski                                           |       Owner:  mjs 
     Type:  defect                                             |      Status:  new 
 Priority:  minor                                              |   Milestone:      
Component:  OsiClp                                             |     Version:  0.96
 Keywords:  ClpPresolve ClpSimplex presolvedModel memory leak  |  
---------------------------------------------------------------+------------
 Dear COIN,
 ClpSimplex::initialSolve() creates instances of ClpSimplex using model2 =
 pinfo.presolvedModel() (ClpPresolve::presolvedModel()) which are not
 deleted under circumstances.
 I solved the problem for my purposes by deleting the instance pointed by
 ClpPresolve::presolvedModel_ in the destructor of ClpPresolve. In order to
 avoid segmentation faults in certain cases, after
 ClpSimplex::initialSolve() still decided to delete the instance pointed by
 model2, the deletion was prohibited in ClpSimples::initialSolve().
 I attach a diff file for my solution. Please see it as a proposal and a
 complement to the bug description rather than a reliable solution. After
 patching with this diff, the cleanup works correctly for at least my
 optimization problems.
 I didn't investigate the bug for the recent version 0.98 of Osi. A simple
 test basing on counting of new and delete calls for my problem shows
 memory leaks for this new version as well.
 Please let me know, if you need any test data for the problem detection. I
 fill the model using directly the C++ interface, but I hope, I'll be able
 to generate an MPS file for it.
 Regards and thanks in advance
 Daniel

-- 
Ticket URL: <https://projects.coin-or.org/Osi/ticket/52>
COIN-OR Open Solver Interface <http://projects.coin-or.org/Osi>
An API for a variety of LP and MIP solvers (and more).



More information about the Osi-tickets mailing list