Originally posted by: nlp7
Hi,
I do have a problem with the memory management of c++ CPLEX. I have a common IloEnv, and several (let's say 5 identical made with the deepCopy procedure described here https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014816307) models and their associated cplex objects that utilize the same variables and constraints.
At some point, I decide to kill one of the 5 models. So I execute:
cplex.clearModel();
cplex.end();
model.end();
I do not remove the variables and the constraints, since they are used in other models too, and doing so would lead to a segfault.
I check with the IloIterator the number of models, and there are indeed 4 models now. In addition, env.getMemoryUsage(), shows a decrease in heap utilization.However, in the task manager I do not see a decrease. I continue my experiment by removing all of the models and the cplex objects (but not the variables and the constraints), the env.getMemoryUsage() shows indeed a huge decrease, something that does not reflect in the memory reported by the task manager. As you understand, this leads to a "leak", since there is no way to reduce the memory utilized by the process, and it will only increase if I keep adding and removing models.
The only way to release the memory and see a reduction in the task manager is to execute env.end().
Any suggestions?
#CPLEXOptimizers#DecisionOptimization