Originally posted by: JDalal
I am trying to implement a heuristic approach to solve a MIP repeatedly and encountered out of memory issue. After monitoring thru windows task manager, I have correctly identified where the issue lies, but can't figure out an improvement of it. Any suggestion would be helpful.
This is the pseudo code of what I try to do:
//declaring env, model, variables in usual way...
IloEnv env;
IloModel my_model(env);
...
...
my_model = constructModel();//constructed IloModel
for(int i=0;i<N;i++){ // N is a user specified integer
...
solveByHeuristic(my_model);
...
}
my_model.end();
env.end();
Now, my solveByHeuristic() method also solves the model within a loop, with different parameter settings each time. I don't want to construct the model every time. So, I did model construction once, before the for loop starts. But, as a result the memory is accumulating and giving error. I can't use end() inside for loop, since in the next iteration it will cause error due to "empty model". What is the correct way to clear memory ?
#CPLEXOptimizers#DecisionOptimization