Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Call CPLEX in Loops

    Posted 03/16/12 03:51 AM

    Originally posted by: Misow


    Hello everybody,

    I've a question on how to call CPLEX (out of C++) in loops correctly.
    I have a small programm that uses a for-loop to solve different MIPs. Example:
    for(int counter=0;counter<100;counter++)
    {
       IloEnv env;
       ...
       ...
       env.end();
    }
    


    I realize that the working memory consumption of my tool grows while running. Can I avoid the increasing memory usage? I thought by calling "env.end();" everything is done properly.

    Thank you very much for the help.

    Best regards
    Misow
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Call CPLEX in Loops

    Posted 03/16/12 05:27 AM

    Originally posted by: SystemAdmin


    Your assumption is correct, this is the way how to implement it. You may be suffering from memory leaks, either in CPLEX or in your own code.
    What version of CPLEX do you use? On which OS?
    Does the problem persist if you only use a single thread (cplex.setParam(IloCplex::Threads, 1))?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Call CPLEX in Loops

    Posted 03/16/12 05:56 AM

    Originally posted by: Misow


    Hello,

    thanks for your answer! Fortunately, the memory leak is no problem due to enough working memory :-).

    I'm using CPLEX 12.2 (OS Windows 7). I tried your hint to use only one processor, but nothing changed.
    If you are interested in reprodcing the problem: I just used the example "ilolpex3" in a for-loop.

    Most important (for me) is, that the implementation is right. But anything without a memory leak would be better, of course :-).

    Many thanks again! Best regards
    Misow
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Call CPLEX in Loops

    Posted 04/20/12 08:52 AM

    Originally posted by: SystemAdmin


    I could not reproduce the issue here but several memory issues were fixed in versions 12.3 and 12.4. So I suggest to eventually upgrade to one of these versions and see if the problem persists.
    #CPLEXOptimizers
    #DecisionOptimization