Originally posted by: lbr33
Hi,
I am using env.end() and variations of that to free up memory after creating and solving a LP model but it does not seem to be working.
In the mainf function I have a while in which I have someting like that:
CPX_flowMAXCUT flowMaxCut;
IloEnv env = flowMaxCut.env;
flowMaxCut.mod = IloModel(env);
flowMaxCut.cplex = IloCplex(flowMaxCut.mod);
getrusage(RUSAGE_SELF,&r_usage);
printf("Memory usage before creating and solving the model = %ld\n",r_usage.ru_maxrss);
s = functionThatCreatesAndSOlveTheModel (flowMaxCut);
getrusage(RUSAGE_SELF,&r_usage);
printf("Memory usage after creating and solving the model = %ld\n",r_usage.ru_maxrss);
flowMaxCut.cplex.end();
flowMaxCut.mod.end();
flowMaxCut.env.end();
getrusage(RUSAGE_SELF,&r_usage);
printf("Memory usage after deleting the structure = %ld\n",r_usage.ru_maxrss);
The value of the memory usage after creating and solving the model is larger than the value of the memory usage before it (as it was expected).
But, the value of the memory usage after deleting the structure is the same as the value of the memory usage after creating and solving the model.
Is it normal?
In the task manager, memory usage keeps increasing.
#CPLEXOptimizers#DecisionOptimization