Matlab error "out of memory"

1 view (last 30 days)
Nikolas Spiliopoulos
Nikolas Spiliopoulos on 9 May 2019
Hi all,
I am running an optimization using fmincon. Initially, I run it with 3 minutes timestep and it runs fine. Afterwards, I run it with 1minute timestep and I get the following error:
Error using ldl
Out of memory. Type HELP MEMORY for your options.
Error in formAndFactorKKTmatrix
Error in formAndFactorKKTmatrix
Error in computeTrialStep
Error in barrier
Error in fmincon (line 798)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] =
barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in P2P_TF_fault (line 383)
[x,fval]=fmincon(f,x0,A,b,Aeq,beq,lb,[],[],options);
I have seen some similar questions but I don't understand how you fix that. I run the 3-minute optimization in a computer with 8GB RAM and it ran fine. Then for the 1-minute I used one with 32GB RAM installed, so it's a bit odd as this amount of RAM should be more than enough.
indicatively, matrix A has a size [4800 X 4790] for the 3 minute optimization
and becomes [14400X14390] in the 1 minute optimization.
the memory of the system and the memory used is the following:
Maximum possible array: 54139 MB (5.677e+10 bytes) *
Memory available for all arrays: 54139 MB (5.677e+10 bytes) *
Memory used by MATLAB: 5658 MB (5.933e+09 bytes)
Physical Memory (RAM): 32678 MB (3.427e+10 bytes)
I hope the question is clear,
many thanks
Nikolas

Answers (1)

Pruthvi Muppavarapu
Pruthvi Muppavarapu on 15 May 2019
Hi Nikolas,
The error looks like it might have been caused by the 'barrier.m' function which is called by the interior-point method. You could try changing the "fmincon" options to use "trust-region-reflective" algorithm instead ( a gradient needs to provided to use this algorithm).
Feel free to refer to the following page to learn more about fmincon options:
Hope this helps.
Regards,
Pruthvi
  1 Comment
Nikolas Spiliopoulos
Nikolas Spiliopoulos on 16 May 2019
thanks a lot, I am gonna give it a try or break the optimization in smaller ones
thanks again!

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!