#12004: copying a linear program using Coin solver consumes enormous amounts of
memory
----------------------------------+-----------------------------------------
Reporter: john_perry | Owner: john_perry
Type: defect | Status: needs_info
Priority: major | Milestone: sage-4.8
Component: linear programming | Keywords: linear programming, Coin,
copy, memory
Work_issues: | Upstream: Reported upstream.
Developers acknowledge bug.
Reviewer: | Author: john_perry
Merged: | Dependencies:
----------------------------------+-----------------------------------------
Changes (by john_perry):
* status: new => needs_info
* upstream: Not yet reported upstream; Will do shortly. => Reported
upstream. Developers acknowledge bug.
Comment:
Upstream replies pretty quickly, once you get the right mailing list.
`:-)`
> I may be wrong but in my experience OsiCbcSolverInterface has several
problems and should not be used. If your problem is a linear program, you
should use OsiClpSolverInterface instead. Once you load the problem in an
object of class OsiClpSolverInterface, you can use the clone() method to
obtain copies.
I can verify that modifying the test program above in this way means we
can clone without an exponential memory leak:
{{{
#include "include/coin/OsiClpSolverInterface.hpp"
#include <stdio.h>
int main() {
OsiClpSolverInterface * si = new OsiClpSolverInterface();
OsiClpSolverInterface * newsi;
for (int i = 0; i < 13; i++) {
printf("%d ", i);
newsi = dynamic_cast <OsiClpSolverInterface *>((*si).clone());
delete si;
si = newsi;
}
printf("\n");
while (true) {}
}
}}}
(FWIW putting `newsi = ...; delete si; si = newsi;` didn't affect the
previous version of the code, either.)
So, now I have a question. Is there a reason we're using the
`OsiCbcSolverInterface` instead of the `OsiClpSolverInterface`? or is it
okay to switch interfaces?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12004#comment:20>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.