Skip to content

Instantly share code, notes, and snippets.

@rocarvaj
Created September 4, 2014 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rocarvaj/7067912f1f5a02e4bad3 to your computer and use it in GitHub Desktop.
Save rocarvaj/7067912f1f5a02e4bad3 to your computer and use it in GitHub Desktop.
CPLEX running out of memory #blog

"CPLEX Error 1001: Out of memory", a tip that might help you too

`CPLEX Error 1001: Out of memory`

Now that's something I hate to see. Especially if you are just trying to solve the "small" problems in you target instance set.

Of course there are many reasons for this to happen. You can try to get some help/inspiration from:

  • Asking or searching (for lost souls with similar problem) in the CPLEX forum.
  • Following the advice of this technote from the IBM Support site.

In my case, I could not find a solution using the resources above. Maybe I did a lousy job searching, but in any case I want to leave a note here in case someone else finds it helpful.

I was solving the same MIP again and again, at each iteration I would only change the objective function of the problem and reoptimize with CPLEX. Each problem would solve usually in around a second, but after around 30 minutes I would get the "1001 of death".

The problem: Since I was using the same CPLEX environment and problem to reoptimize, solutions found at each iteration were kept in the solution pool. The solution pool started to grow like crazy and CPLEX would run out of memory.

The solution: Use the CPX_PARAM_SOLNPOOLCAPACITY parameter to control the maximum number of solutions kept in the solution pool.

That's it. I hope this eventually helps someone out there.

Edit: As Bo Jensen points out, is not always easy to just throw away solutions without hurting performance. Maybe a good solution is to limit the pool size, but also play with the CPX_PARAM_SOLNPOOLREPLACE parameter, which controls the replacement strategy for when the pool is full and a new solution appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment