0

I wrote a linear program in Matlab using the modelling library YALMIP and I want to solve it with Cplex. The program constructs well then it calls cplexlp to solve the problem but Cplex run out of memory and I get this error:

Parallel mode: deterministic, using up to 2 threads for concurrent optimization.
Aggregator has done 101 substitutions...
Tried aggregator 1 time.
LP Presolve eliminated 720048 rows and 176294 columns.
Aggregator did 52806 substitutions.
Reduced LP has 383867 rows, 454203 columns, and 1324735 nonzeros.
Error using cplexlp (line 254)
CPLEX Error  1001: Out of memory.

When I export the problem to a lp file, Cplex reads the lp file and solves the problem well.

My first thought was that Matlab could not allocate more memory but it doesn't allocate more than a 1.3 GB while there was more that 1 GB of free RAM. I tried to increase the SWAP to 5 GB but it didn't work.

I also tried to change Cplex parameter. I entered a bigger value for the workMem parameter (2000.0) but it didn't work. Then I tried set the memory Emphasis parameter to one, it has compress the matrix from 58 MB to 17 MB but it solves the problem only in 50% of cases.

If someone have an idea to solve this problem, I would really appreciate the help. Thank you

computer characteristic: Windows 7 32 bits Intel celeron 2.5 Ghz with 4 GB RAM

6
  • Have you tried just using MATLAB's interface to CPLEX instead of using YALMIP? Commented Sep 17, 2013 at 14:56
  • No I didn't try it. YALMIP is just the modeler that constructs from my modelisation the following parameters that are sent to cplex: f,Aineq,bineq,Aeq,beq,lb,ub. The out of memory exception come from Cplex. The modelling of the problem is correct since I resolve the problem when the time step used is lower (Less variables and constraints). Commented Sep 19, 2013 at 8:06
  • If you're explicitly constructing f,Aineq,bineq,Aeq,beq,lb,ub, then why not just use the CPLEX for MATLAB toolbox directly? It may not help, but at least you know that YALMIP isn't the cause of the problem. Commented Sep 20, 2013 at 15:08
  • If you're not explicitly constructing f,Aineq,bineq,Aeq,beq,lb,ub, then it's possible that YALMIP is doing some kind of reformulation and/or presolve that hurts in this case. Commented Sep 20, 2013 at 15:13
  • You are welcome to send the model to me (developer of YALMIP), if you think YALMIP has formulated something strange. However, it looks to me as this is purely CPLEX related, the model is simply large. Commented Sep 20, 2013 at 18:03

2 Answers 2

1

I have often found all sorts of software gets unreliable or hits a memory limit at some point between 1GB and about 1.6GB when I am using 32-bit versions of Windows. Maybe a 64-bit version would work better.

Sign up to request clarification or add additional context in comments.

1 Comment

Unfortunately, I don't have a 64-bit version of windows.
1

The main reason of memory leak is CPlex. After many trials with Cplex, I solved my problem by using GUROBI with Matlab, without encountering any memory leaks. Moreover, run time reduced by approximately %30 . In conclusion, I suggest you to change your solver to Gurobi. It will worth it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.