From rod at frowd.net Mon Jun 9 20:33:11 2008 From: rod at frowd.net (Rod Frowd) Date: Tue, 10 Jun 2008 10:33:11 +1000 Subject: [CoinMp] CoinMP cbc memory leak? Message-ID: <484DCBC7.2080501@frowd.net> I have been running the CBC MIP repetitively from CoinMP.dll and it seems to be leaking memory and growing in size. 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. SOLVAPI int CoinUnloadProblem(HPROB hProb) { PCOIN pCoin = (PCOIN)hProb; if (pCoin) { delete pCoin->clp; if (pCoin->RowLower) free(pCoin->RowLower); if (pCoin->RowUpper) free(pCoin->RowUpper); if (pCoin->IsInt) free(pCoin->IsInt); delete pCoin->cbc; pCoin->cbc = NULL; } free(pCoin); pCoin = NULL; return SOLV_SUCCESS; } Rod Frowd -------------- next part -------------- A non-text attachment was scrubbed... Name: rod.vcf Type: text/x-vcard Size: 302 bytes Desc: not available Url : http://list.coin-or.org/pipermail/coinmp/attachments/20080610/23ebc2fb/attachment.vcf From s.mitchell at auckland.ac.nz Mon Jun 9 21:03:47 2008 From: s.mitchell at auckland.ac.nz (Stuart Mitchell) Date: Tue, 10 Jun 2008 13:03:47 +1200 Subject: [CoinMp] CoinMP cbc memory leak? In-Reply-To: <484DCBC7.2080501@frowd.net> References: <484DCBC7.2080501@frowd.net> Message-ID: <484DD2F3.5040707@auckland.ac.nz> Note your solution will probably cause an error if the user wishes to solve a linear (not integer) programing problem. I think I generated a ticket for this and some other problems I have found. Note I have produced a new version of CoinMP (I have also had to change the externals so I compiles properly, and some other bug fixes) This can be found on the in the svn source code of pulp-or on http://code.google.com/p/pulp-or/source/browse Rod Frowd wrote: > I have been running the CBC MIP repetitively from CoinMP.dll and it > seems to be leaking memory and growing in size. > > 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. > > SOLVAPI int CoinUnloadProblem(HPROB hProb) > { > PCOIN pCoin = (PCOIN)hProb; > if (pCoin) { > delete pCoin->clp; > if (pCoin->RowLower) free(pCoin->RowLower); > if (pCoin->RowUpper) free(pCoin->RowUpper); > if (pCoin->IsInt) free(pCoin->IsInt); > delete pCoin->cbc; > pCoin->cbc = NULL; > } > free(pCoin); > pCoin = NULL; > return SOLV_SUCCESS; > } > > > Rod Frowd > _______________________________________________ > CoinMp mailing list > CoinMp at list.coin-or.org > http://list.coin-or.org/mailman/listinfo/coinmp > -- ___________________________________ Dr Stuart Mitchell Pasifika Mentor / Lecturer Department of Engineering Science University of Auckland Private Bag 92019 Auckland New Zealand Ph (wk) +64 (9) 3737599 ext 84538/84970 (mb) +64 (21) 441331 ___________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: s.mitchell.vcf Type: text/x-vcard Size: 368 bytes Desc: not available Url : http://list.coin-or.org/pipermail/coinmp/attachments/20080610/23bdd005/attachment.vcf From rod at frowd.net Mon Jun 9 21:19:30 2008 From: rod at frowd.net (Rod Frowd) Date: Tue, 10 Jun 2008 11:19:30 +1000 Subject: [CoinMp] CoinMP cbc memory leak? In-Reply-To: <484DD2F3.5040707@auckland.ac.nz> References: <484DCBC7.2080501@frowd.net> <484DD2F3.5040707@auckland.ac.nz> Message-ID: <484DD6A2.1080100@frowd.net> Stuart: I have run this on an LP and it does not generate an error. Deleting a pointer that is NULL is just a noop. Thanks Rod Stuart Mitchell wrote: > Note your solution will probably cause an error if the user wishes to > solve a linear (not integer) programing problem. > > I think I generated a ticket for this and some other problems I have > found. > > Note I have produced a new version of CoinMP (I have also had to > change the externals so I compiles properly, and some other bug fixes) > > This can be found on the in the svn source code of pulp-or on > http://code.google.com/p/pulp-or/source/browse > Rod Frowd wrote: >> I have been running the CBC MIP repetitively from CoinMP.dll and it >> seems to be leaking memory and growing in size. >> >> 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. >> >> SOLVAPI int CoinUnloadProblem(HPROB hProb) >> { >> PCOIN pCoin = (PCOIN)hProb; >> if (pCoin) { >> delete pCoin->clp; >> if (pCoin->RowLower) free(pCoin->RowLower); >> if (pCoin->RowUpper) free(pCoin->RowUpper); >> if (pCoin->IsInt) free(pCoin->IsInt); >> delete pCoin->cbc; >> pCoin->cbc = NULL; >> } >> free(pCoin); >> pCoin = NULL; >> return SOLV_SUCCESS; >> } >> >> >> Rod Frowd >> _______________________________________________ >> CoinMp mailing list >> CoinMp at list.coin-or.org >> http://list.coin-or.org/mailman/listinfo/coinmp >> > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rod.vcf Type: text/x-vcard Size: 302 bytes Desc: not available Url : http://list.coin-or.org/pipermail/coinmp/attachments/20080610/854a2ba2/attachment.vcf