Reputation: 13666
I'm using CPLEX through the Java API (that relies on JNI). I have a single application running and solving million problems in sequence. The problem itself is straightforward and it is solved in milliseconds.
I have this setting to avoid using excessive memory
cplex = new IloCplex();
//...model definition
cplex.setParam(IloCplex.IntParam.WorkMem, 512);
cplex.setParam(IloCplex.DoubleParam.TreLim, 1024);
cplex.setParam(IloCplex.IntParam.NodeFileInd, 3);
But trust me, it is so small that I never exceed that amount of memory. The problem arises after hours of runtime. The application exit with 127 error. I'm pretty sure that the CPLEX library is keeping in memory instances of cplex that after million of runs are exhausting my RAM.
What should I do, create a single cplex object and enforce memory deletion of the created model? Is cplex.clearModel();
enough?
Upvotes: 0
Views: 131
Reputation: 13666
I had to call cplex.end()
to release all the variables created after each solve of a formulation.
Upvotes: 0