Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Suggestion wanted on memory issue

    Posted 09/06/12 02:34 PM

    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


  • 2.  Re: Suggestion wanted on memory issue

    Posted 09/07/12 06:02 PM

    Originally posted by: SystemAdmin


    I'd suggest that you run the code through a profiler and find out as nearly as possible where the memory is leaking. If you don't have a profiler, you can find suggestions here.

    When you refer to changing "parameter settings", you mean just things you access with SetParam, correct? (Some people refer to model coefficients as "parameters".) Changing parameters should not cause you to leak memory. Changing the model might.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Suggestion wanted on memory issue

    Posted 09/17/12 04:49 PM

    Originally posted by: SystemAdmin


    From what you are saying I would guess the problem is in solveByHeuristic(). Do you allocate any objects in the for-loop or in solveByHeuristic() that you fail to release? In particular, do you construct any objects that take an 'env' argument in their constructor and fail to end() them at the end of the loop or solveByHeuristics()? This could easily result in leaking memory.
    #CPLEXOptimizers
    #DecisionOptimization