Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

The memory is not released after IloCplex::Solve() is invoke

  • 1.  The memory is not released after IloCplex::Solve() is invoke

    Posted 07/01/14 04:33 AM

    Originally posted by: Falcon_G


    Hi everybody

    Let say I get he memory usage of IloEnv  using getMemoryUsage().

    I have the following situation:

    1. empty model. MemUsage::16896

    2. variables added: MemUsage::915728 (number of vars 14140)

    3. objectuve function expression (not obj itself) is created : MemUsage::1142024

    4. some constraints are added to an IlorangeArray:  MemUsage::1302856

    5. some iloexpr are created and put in an array  (32200 precisely): MemUsage::5092792

    6.  If I just decide to make a test, after following I can have :MemUsage::4982792

      model.end();
      model = IloModel(env);
      model.add(m_rng_design);

    7. adding IloObj and IloCplex does not occupy more memory and memory remains the same.

    8.               IloExpr tmp = cx + lag;
                      obj.setExpr(tmp);
                      tmp.end();
    turns :MemUsage::5212352

    NOW: if I invoke:

      cplex.clearModel();
      cplex.end();
      model.remove(obj);
      obj.getExpr().end();

     

    it comes back to the more or less same MemUsage::4982792.

    BUT if I inolve IloCPlex::Solve()

    Then memory usage becomes  :MemUsage::5556752

    and with all:

      cplex.clearModel();
      cplex.end();
      model.remove(obj);
      obj.getExpr().end();

    it becomes MemUsage::5209432

    and never goes back to MemUsage::4982792.

     

    I have no idea where this memory is occupied.

    Moreover, I seek solution NOT proposing to use IloEnv::end().

    I appreciate any constructive comment.

    Thank you in avance

     

     


     

     

     

     

     

     

     


     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: The memory is not released after IloCplex::Solve() is invoke

    Posted 08/04/14 12:49 PM

    Off the top of my head I don't see where memory could go. One idea for debugging this is to use IloIterator along with getMemoryUsage(). Using IloIterator<IloExtractable> you should be able to iterate over all extractables created for the IloEnv instance and these extractables should constitute the memory usage returned by getMemoryUsage(). Using IloExtractable::getId() you can create a list/set of extractables that exist at a certain point. If you store this set/list every time you invoke getMemoryUsage() then you can easily figure out which extractables were created/deleted between two snapshots. Maybe this can tell you where memory goes? I know it will be cumbersome but is the best I can think of at the moment.


    #CPLEXOptimizers
    #DecisionOptimization