Originally posted by: UDOPS
I am having memory and model expansion problems with a lagrangian loop when the data set is large. As part of this I have been refining my model and trying to improve memory management where ever possible. Part of this includes carefully "end()ing" model components. I am referring to the documentation and cutstock example, and I am not clear what the proper creation and ending sequence should be.
For example, in the cutstock example, some elements are create new outside a loop, and some elements are created new repeatedly inside a loop.
For example, masterOpl is created outside the loop, and re-used repeatedly inside the loop:
var masterOpl = new IloOplModel(masterDef, masterCplex);
(inside while loop)
masterOpl.end();
masterOpl = new IloOplModel(masterDef,masterCplex);
But in constrast, subOpl is created repeatedly inside the loop, with a fresh "var" statement each time. Why the different structure for model elements in the same file, and how does this impact memory management?
(inside while loop)
var subOpl = new IloOplModel(subDef,subCplex);
subOpl.end();
And finally, what does "end()" really mean, since it clearly does not delete the initial "var" declaration, but merely frees the contents? It appears the "var" statement is persistent after any related call to .end().
#DecisionOptimization#OPLusingCPLEXOptimizer