Decision Optimization

 View Only
Expand all | Collapse all

CPLEX Out of Memory -> get last solution (Java)

  • 1.  CPLEX Out of Memory -> get last solution (Java)

    Posted Wed May 20, 2020 10:45 AM
    Dear all,
    I have the following problem: My CPLEX model runs into an out-of-memory-error (1001). This is to be expected, but I would like to retain the last solution (incumbent and gap, as well as all variable values). 
    try {
        if (cplex.solve()) {
             //feasible and ran without memory issues
        } else {
             //infeasible
         }
    } catch (IloException e) {
         e.printStackTrace();
         //memory issues end up in here
    }

    The problem is that I "end up" in the catch part, where I can no longer retain any variable values, objective function values etc. 
    Is there a work-around to help me get the last found solution?
    THANK YOU!
    Layla

    (PS.: Sorry for possibly posting twice, I think my first post "didn't go through")

    ------------------------------
    Layla Martin
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CPLEX Out of Memory -> get last solution (Java)

    Posted Wed May 20, 2020 11:18 AM
    This question was cross-posted on stackoverflow here. It looks like you have accepted the answer there. In the future please pick one or the other (we watch both) so that we can avoid duplicate work among our team.

    ------------------------------
    Ryan Kersh
    ------------------------------