Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Freeing up memory

    Posted 12/12/11 09:27 AM

    Originally posted by: anahana


    Hi,

    I'm using CP to solve a number of instances (100 for now, but potentially there should be much more), I'm facing an error: "Not enough memory" after about 14 instances, after which the program stops of course. I used env.getTotalMemory() to see how much I use after solving each instance, and the number goes up to about 1.6 GB. Is there a way to free up the memory used by the environment(assuming this is the cause of the problem) after solving each instance? env.end() won't work as I still need some of the objects created to move on to the next instance.

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Freeing up memory

    Posted 12/15/11 03:56 AM

    Originally posted by: ol


    Hello,
    env.end() is the right thing to do. If you need to use the computations from one instance to the following, I suggest to allocate them on another memory allocator, or to copy them from the env before the env.end().

    Regards
    Olivier
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Freeing up memory

    Posted 12/16/11 08:36 AM

    Originally posted by: anahana


    I'll just try to create another instance of IloEnv and use it.

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Freeing up memory

    Posted 01/03/12 12:26 AM

    Originally posted by: anahana


    Sorry to open this subject again, but I need some advice. From the previous communication you can see that I had, and still have, problems with the memory. I discovered that a lot of memory is being used when I create instances of classes for the VRP (specifically instances of RoutingModel and RoutingSolver, same as given in CP's examples). As I'm solving a lot of problem instances, I had to create instances of these classes within loops, which is consuming a lot of memory (as I noticed by tracking the env.getTotalMemoryUsage method). Is there a way to free up the memory allocated for these classes after use?

    Regard,
    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Freeing up memory

    Posted 01/03/12 04:04 AM

    Originally posted by: rdumeur


    Dear anahana,

    I think the safest way, as stated earlier, would be use an IloEnv for each instance. Deleting this IloEnv once the instance is solved would free all the objects allocated to process the instance.
    Be careful to pass this IloEnv as a parameter to your RoutingModel and RoutingSolver classes (instead of creating an IloEnv as it is done in the given RoutingSolver class) so that all the objects they allocate can be eventually destroyed when env.end() is called.

    Cheers,

    Renaud
    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: Freeing up memory

    Posted 01/03/12 02:46 PM

    Originally posted by: anahana


    Thanks Renaud, I guess I don't have any other option. I did that and it solved the problem.

    Regards,
    #CPOptimizer
    #DecisionOptimization