[Coin-lpsolver] Memory leak in Clp/branches/devel

fmargot at andrew.cmu.edu fmargot at andrew.cmu.edu
Tue Nov 21 12:52:06 EST 2006


I don't know if Clp/branches/devel is active or not, but it seems that
there is a memory leak in Clp there. Running:

   for(i=0; i<10; i++) {
     OsiClpSolverInterface *clp = new OsiClpSolverInterface;
     clp->readMps("seymour.mps");
     clp->initialSolve();
     delete clp;
   }

where seymour.mps is the standard MIPLIB file, the memory usage increases
regularly (this does not happen with Clp1.3.3). Valgrind sees many leaks,
but I don't know which ones are real (the report below is for one loop only):

==27819== searching for pointers to 16 not-freed blocks.
==27819== checked 634,164 bytes.
==27819== 
==27819== 60 bytes in 1 blocks are indirectly lost in loss record 1 of 12
==27819==    at 0x400597C: operator new(unsigned) (vg_replace_malloc.c:164)
==27819==    by 0x80B5965: ClpPackedMatrix::ClpPackedMatrix(CoinPackedMatrix const&) (ClpPackedMatrix.cpp:100)
==27819==    by 0x8091D7D: ClpModel::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpModel.cpp:313)
==27819==    by 0x80DFA6E: ClpSimplex::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpSimplex.cpp:5871)
==27819==    by 0x80BE412: CoinPresolveMatrix::update_model(ClpSimplex*, int, int, int) (ClpPresolve.cpp:1223)
==27819==    by 0x80C0BE5: ClpPresolve::gutsOfPresolvedModel(ClpSimplex*, double, bool, int, bool, bool) (ClpPresolve.cpp:1549)
==27819==    by 0x80BDC5D: ClpPresolve::presolvedModel(ClpSimplex&, double, bool, int, bool, bool) (ClpPresolve.cpp:103)
==27819==    by 0x812A71C: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:592)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 547,328 (120 direct, 547,208 indirect) bytes in 2 blocks are definitely lost in loss record 2 of 12
==27819==    at 0x400597C: operator new(unsigned) (vg_replace_malloc.c:164)
==27819==    by 0x80B9B4C: ClpPlusMinusOneMatrix::getPackedMatrix() const (ClpPlusMinusOneMatrix.cpp:1049)
==27819==    by 0x806251C: ClpModel::matrix() const (ClpModel.hpp:555)
==27819==    by 0x80BEE79: CoinPostsolveMatrix::CoinPostsolveMatrix(ClpSimplex*, int, int, int, double, double*, double*, unsigned char*, unsigned char*) (ClpPresolve.cpp:1298)
==27819==    by 0x80C356A: ClpPresolve::postsolve(bool) (ClpPresolve.cpp:227)
==27819==    by 0x8131137: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:2211)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 141,572 (96 direct, 141,476 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 12
==27819==    at 0x400597C: operator new(unsigned) (vg_replace_malloc.c:164)
==27819==    by 0x8091D68: ClpModel::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpModel.cpp:313)
==27819==    by 0x80DFA6E: ClpSimplex::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpSimplex.cpp:5871)
==27819==    by 0x80BE412: CoinPresolveMatrix::update_model(ClpSimplex*, int, int, int) (ClpPresolve.cpp:1223)
==27819==    by 0x80C0BE5: ClpPresolve::gutsOfPresolvedModel(ClpSimplex*, double, bool, int, bool, bool) (ClpPresolve.cpp:1549)
==27819==    by 0x80BDC5D: ClpPresolve::presolvedModel(ClpSimplex&, double, bool, int, bool, bool) (ClpPresolve.cpp:103)
==27819==    by 0x812A71C: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:592)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 4,612 bytes in 1 blocks are indirectly lost in loss record 4 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BADE8: CoinPackedMatrix::gutsOfCopyOfNoGaps(bool, int, int, double const*, int const*, int const*) (CoinPackedMatrix.cpp:2190)
==27819==    by 0x81BB0A1: CoinPackedMatrix::CoinPackedMatrix(CoinPackedMatrix const&) (CoinPackedMatrix.cpp:1946)
==27819==    by 0x80B597A: ClpPackedMatrix::ClpPackedMatrix(CoinPackedMatrix const&) (ClpPackedMatrix.cpp:100)
==27819==    by 0x8091D7D: ClpModel::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpModel.cpp:313)
==27819==    by 0x80DFA6E: ClpSimplex::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpSimplex.cpp:5871)
==27819==    by 0x80BE412: CoinPresolveMatrix::update_model(ClpSimplex*, int, int, int) (ClpPresolve.cpp:1223)
==27819==    by 0x80C0BE5: ClpPresolve::gutsOfPresolvedModel(ClpSimplex*, double, bool, int, bool, bool) (ClpPresolve.cpp:1549)
==27819==    by 0x80BDC5D: ClpPresolve::presolvedModel(ClpSimplex&, double, bool, int, bool, bool) (ClpPresolve.cpp:103)
==27819==    by 0x812A71C: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:592)
==27819== 
==27819== 
==27819== 4,616 bytes in 1 blocks are indirectly lost in loss record 5 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BAE31: CoinPackedMatrix::gutsOfCopyOfNoGaps(bool, int, int, double const*, int const*, int const*) (CoinPackedMatrix.cpp:2192)
==27819==    by 0x81BB0A1: CoinPackedMatrix::CoinPackedMatrix(CoinPackedMatrix const&) (CoinPackedMatrix.cpp:1946)
==27819==    by 0x80B597A: ClpPackedMatrix::ClpPackedMatrix(CoinPackedMatrix const&) (ClpPackedMatrix.cpp:100)
==27819==    by 0x8091D7D: ClpModel::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpModel.cpp:313)
==27819==    by 0x80DFA6E: ClpSimplex::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpSimplex.cpp:5871)
==27819==    by 0x80BE412: CoinPresolveMatrix::update_model(ClpSimplex*, int, int, int) (ClpPresolve.cpp:1223)
==27819==    by 0x80C0BE5: ClpPresolve::gutsOfPresolvedModel(ClpSimplex*, double, bool, int, bool, bool) (ClpPresolve.cpp:1549)
==27819==    by 0x80BDC5D: ClpPresolve::presolvedModel(ClpSimplex&, double, bool, int, bool, bool) (ClpPresolve.cpp:103)
==27819==    by 0x812A71C: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:592)
==27819== 
==27819== 
==27819== 9,224 bytes in 2 blocks are indirectly lost in loss record 6 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BA4D9: CoinPackedMatrix::gutsOfOpEqual(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:2240)
==27819==    by 0x81BA9BD: CoinPackedMatrix::CoinPackedMatrix(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:1725)
==27819==    by 0x80B9B99: ClpPlusMinusOneMatrix::getPackedMatrix() const (ClpPlusMinusOneMatrix.cpp:1049)
==27819==    by 0x806251C: ClpModel::matrix() const (ClpModel.hpp:555)
==27819==    by 0x80BEE79: CoinPostsolveMatrix::CoinPostsolveMatrix(ClpSimplex*, int, int, int, double, double*, double*, unsigned char*, unsigned char*) (ClpPresolve.cpp:1298)
==27819==    by 0x80C356A: ClpPresolve::postsolve(bool) (ClpPresolve.cpp:227)
==27819==    by 0x8131137: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:2211)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 9,232 bytes in 2 blocks are indirectly lost in loss record 7 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BA559: CoinPackedMatrix::gutsOfOpEqual(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:2247)
==27819==    by 0x81BA9BD: CoinPackedMatrix::CoinPackedMatrix(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:1725)
==27819==    by 0x80B9B99: ClpPlusMinusOneMatrix::getPackedMatrix() const (ClpPlusMinusOneMatrix.cpp:1049)
==27819==    by 0x806251C: ClpModel::matrix() const (ClpModel.hpp:555)
==27819==    by 0x80BEE79: CoinPostsolveMatrix::CoinPostsolveMatrix(ClpSimplex*, int, int, int, double, double*, double*, unsigned char*, unsigned char*) (ClpPresolve.cpp:1298)
==27819==    by 0x80C356A: ClpPresolve::postsolve(bool) (ClpPresolve.cpp:227)
==27819==    by 0x8131137: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:2211)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 132,188 bytes in 1 blocks are indirectly lost in loss record 8 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BAF25: CoinPackedMatrix::gutsOfCopyOfNoGaps(bool, int, int, double const*, int const*, int const*) (CoinPackedMatrix.cpp:2212)
==27819==    by 0x81BB0A1: CoinPackedMatrix::CoinPackedMatrix(CoinPackedMatrix const&) (CoinPackedMatrix.cpp:1946)
==27819==    by 0x80B597A: ClpPackedMatrix::ClpPackedMatrix(CoinPackedMatrix const&) (ClpPackedMatrix.cpp:100)
==27819==    by 0x8091D7D: ClpModel::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpModel.cpp:313)
==27819==    by 0x80DFA6E: ClpSimplex::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpSimplex.cpp:5871)
==27819==    by 0x80BE412: CoinPresolveMatrix::update_model(ClpSimplex*, int, int, int) (ClpPresolve.cpp:1223)
==27819==    by 0x80C0BE5: ClpPresolve::gutsOfPresolvedModel(ClpSimplex*, double, bool, int, bool, bool) (ClpPresolve.cpp:1549)
==27819==    by 0x80BDC5D: ClpPresolve::presolvedModel(ClpSimplex&, double, bool, int, bool, bool) (ClpPresolve.cpp:103)
==27819==    by 0x812A71C: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:592)
==27819== 
==27819== 
==27819== 264,376 bytes in 1 blocks are indirectly lost in loss record 9 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BA70C: CoinPackedMatrix::gutsOfOpEqual(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:2270)
==27819==    by 0x81BA9BD: CoinPackedMatrix::CoinPackedMatrix(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:1725)
==27819==    by 0x80B9B99: ClpPlusMinusOneMatrix::getPackedMatrix() const (ClpPlusMinusOneMatrix.cpp:1049)
==27819==    by 0x806251C: ClpModel::matrix() const (ClpModel.hpp:555)
==27819==    by 0x80BEE79: CoinPostsolveMatrix::CoinPostsolveMatrix(ClpSimplex*, int, int, int, double, double*, double*, unsigned char*, unsigned char*) (ClpPresolve.cpp:1298)
==27819==    by 0x80C356A: ClpPresolve::postsolve(bool) (ClpPresolve.cpp:227)
==27819==    by 0x8131137: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:2211)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 264,376 bytes in 1 blocks are possibly lost in loss record 10 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BA70C: CoinPackedMatrix::gutsOfOpEqual(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:2270)
==27819==    by 0x81BA9BD: CoinPackedMatrix::CoinPackedMatrix(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:1725)
==27819==    by 0x80B9B99: ClpPlusMinusOneMatrix::getPackedMatrix() const (ClpPlusMinusOneMatrix.cpp:1049)
==27819==    by 0x806251C: ClpModel::matrix() const (ClpModel.hpp:555)
==27819==    by 0x80DE206: ClpSimplex::tightenPrimalBounds(double, int) (ClpSimplex.cpp:3948)
==27819==    by 0x812B619: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:847)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 264,376 bytes in 2 blocks are indirectly lost in loss record 11 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BA725: CoinPackedMatrix::gutsOfOpEqual(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:2271)
==27819==    by 0x81BA9BD: CoinPackedMatrix::CoinPackedMatrix(bool, int, int, int, double const*, int const*, int const*, int const*) (CoinPackedMatrix.cpp:1725)
==27819==    by 0x80B9B99: ClpPlusMinusOneMatrix::getPackedMatrix() const (ClpPlusMinusOneMatrix.cpp:1049)
==27819==    by 0x806251C: ClpModel::matrix() const (ClpModel.hpp:555)
==27819==    by 0x80DE206: ClpSimplex::tightenPrimalBounds(double, int) (ClpSimplex.cpp:3948)
==27819==    by 0x812B619: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:847)
==27819==    by 0x8061F4B: OsiClpSolverInterface::initialSolve() (OsiClpSolverInterface.cpp:281)
==27819==    by 0x804AE9F: main (clp_cut.cpp:455)
==27819== 
==27819== 
==27819== 264,376 bytes in 1 blocks are possibly lost in loss record 12 of 12
==27819==    at 0x4005628: operator new[](unsigned) (vg_replace_malloc.c:197)
==27819==    by 0x81BAF0C: CoinPackedMatrix::gutsOfCopyOfNoGaps(bool, int, int, double const*, int const*, int const*) (CoinPackedMatrix.cpp:2211)
==27819==    by 0x81BB0A1: CoinPackedMatrix::CoinPackedMatrix(CoinPackedMatrix const&) (CoinPackedMatrix.cpp:1946)
==27819==    by 0x80B597A: ClpPackedMatrix::ClpPackedMatrix(CoinPackedMatrix const&) (ClpPackedMatrix.cpp:100)
==27819==    by 0x8091D7D: ClpModel::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpModel.cpp:313)
==27819==    by 0x80DFA6E: ClpSimplex::loadProblem(int, int, int const*, int const*, double const*, int const*, double const*, double const*, double const*, double const*, double const*, double const*) (ClpSimplex.cpp:5871)
==27819==    by 0x80BE412: CoinPresolveMatrix::update_model(ClpSimplex*, int, int, int) (ClpPresolve.cpp:1223)
==27819==    by 0x80C0BE5: ClpPresolve::gutsOfPresolvedModel(ClpSimplex*, double, bool, int, bool, bool) (ClpPresolve.cpp:1549)
==27819==    by 0x80BDC5D: ClpPresolve::presolvedModel(ClpSimplex&, double, bool, int, bool, bool) (ClpPresolve.cpp:103)
==27819==    by 0x812A71C: ClpSimplex::initialSolve(ClpSolve&) (ClpSolve.cpp:592)
==27819== 
==27819== LEAK SUMMARY:
==27819==    definitely lost: 216 bytes in 3 blocks.
==27819==    indirectly lost: 688,684 bytes in 11 blocks.
==27819==      possibly lost: 528,752 bytes in 2 blocks.
==27819==    still reachable: 0 bytes in 0 blocks.
==27819==         suppressed: 0 bytes in 0 blocks.
--27819--  memcheck: sanity checks: 14577 cheap, 584 expensive
--27819--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--27819--  memcheck: auxmaps: 0 searches, 0 comparisons
--27819--  memcheck: secondaries: 469 issued (30016k, 29M)
--27819--  memcheck: secondaries: 63 accessible and distinguished (4032k, 3M)
--27819--     tt/tc: 106,697 tt lookups requiring 117,866 probes
--27819--     tt/tc: 106,697 fast-cache updates, 2 flushes
--27819-- translate: new        12,332 (380,762 -> 6,189,966; ratio 162:10) [0 scs]
--27819-- translate: dumped     0 (0 -> ??)
--27819-- translate: discarded  0 (0 -> ??)
--27819-- scheduler: 728,875,564 jumps (bb entries).
--27819-- scheduler: 14,577/218,347 major/minor sched events.
--27819--    sanity: 14578 cheap, 584 expensive checks.
--27819--    exectx: 30,011 lists, 1,286 contexts (avg 0 per list)
--27819--    exectx: 52,988 searches, 51,730 full compares (976 per 1000)
--27819--    exectx: 42 cmp2, 41 cmp4, 0 cmpAll



More information about the Clp mailing list