Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Why doesn't concert end objects in destructor?

    Posted 06/05/13 03:48 PM

    Originally posted by: ArthurRodrigues


    Sorry if this is not the place to talk about such thing, but I was not able to find a "Concert" specific forum or even an issue tracker to make this question. If anyone knows the correct place to post this, please, tell me.

     

    I noticed that, if I do not call the end method of the Concert objects explicitly, the memory used by them is never freed until the call to env.end() (supposing env is the IloEnv associated with these objects I'm talking about).

    This means that calling the objects' destructors do not free the allocated memory automatically, as destructors should behave.

    Is there a reason for this? I'm asking because lots of memory leaks happen in my programs because of such behavior, and some of the memory cannot be recovered until I free the environment object. Also, if some exception is thrown during the code, the objects just lay there useless, as C++ does not have a finally clause as Java does.

    I know that in the case of IloObjectives this desalocation shuld not be automatic, as it could lead to a modification of the models they belong to, but I think it would not hurt to add some kind of reference counter to deal with such cases.

     

    Thank you.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Why doesn't concert end objects in destructor?

    Posted 06/10/13 08:57 AM

    The reasons for having to call end() are sort of historical and we have to live with them for now :-(


    #CPLEXOptimizers
    #DecisionOptimization