Out of memory. Type HELP MEMORY for your options

cvx_begin quiet
variable PEGU(length(y1));
variable PB(length(y1));    
variable SOC(length(y1));
% variable Tt(length(y1));
variable E(length(y1))
subject to

Error using reshape
Out of memory. Type HELP MEMORY for your options.

Error in cvx_sdpt3>solve (line 268)
Avec{end}{end+1} = reshape( ( str_3 * str_2 ) * reshape( At(ti,:), nt, nv * m ), nt2 * nv, m );

Error in cvxprob/solve (line 422)
[ x, status, tprec, iters, y ] = shim.solve(At, b, c, cones, quiet, prec, solv.settings, eargs{:} );

Error in cvx_end (line 87)
solve( prob );

Error in chengxu (line 46)

What should I do? Is the length(y1) (length(y1)=19710) too large?
Thank you.

Sis you try another solver? Can you start with a smaller size problem and see how much memory it takes?

An option which I have mixed feeling about recommending it to install CVX 3.0beta and uses SCS, which is a first order solver, and so should require less memory than second order solvers. However, CVX 3.0beta is very buggy, so it may not work at all, or even it claims to find the optimal solution, it could be wrong.

It looks like building the model exhausts the memory, so switching solver would likely not help.

For models this large, I concur with Mark’s suggestion of prototyping on smaller model. Then use a native solver API for the large models. It is not uncommon that the modeling time in CVX dominates the actual solution time (by MOSEK) by several orders of magnitude.

Thank you Mark.I have re-ran the program by using CVX 3.0beta,but the result is as follows:
number of iterations = 30
residual of primal infeasibility
certificate (y,Z) = 7.87e-29
reldist to infeas. <= 5.04e-20
Total CPU time (secs) = 39.31
CPU time per iteration = 1.31
termination code = 1
DIMACS: 2.8e+01 0.0e+00 8.6e-01 0.0e+00 -1.0e+00 1.6e-04

Status: Infeasible
Optimal value (cvx_optval): +Inf

So I want to know why cvx_optval is ‘+Inf’ and cvx_status is ‘Infeasible’.Is that because constraints are not enough?
Thank you.

That means the solver determined the problem is infeasible. I.e., there is no value of the CVX variabes which simultaneously satisfies all the constraints. Perhaps @Joachim_Dahl can comment on the reliability of that determination based on the displayed certificate. I will warn again though that due to the bugginess of CVX 3.0beta, it us possible that the solver was not even provided the correct constraints for the problem.

Provided that CVX 3.0 solves the correct problem, I would also think that the certificate is very week. The problem is probably ill-posed, in the sense that very small changes of the data will change the solution status between feasible and infeasible.

If you rerun you problem in MOSEK and provide log-output, we can tell you more.

1 Like

Hi,Mark.I want to know how I can install the SCS.

https://github.com/cvxgrp/scs Then reinstall CVX 3.0beta.

But if you are able to get your program to run without running out of memory, there may be no need to. You may want to consiider following @Joachim_Dahl’s advice about trying MOSK.

Thank you very much.

Thank you,Joachim_Dahl.I have some questions when I install license for using mosek.

Installation info:
Path: G:\matlab\1\cvx
MATLAB version: 8.6 (R2015b)
OS: Windows 7 amd64 version 6.1
Java version: 1.7.0_60
Verfying CVX directory contents:
No missing files.
Path: C:\Users\Administrator.AB-201810261518\AppData\Roaming\MathWorks\MATLAB\cvx_prefs.mat
License host:
Username: Administrator
Host ID: d053498da2d3 (eth4)
Installed license:
No license installed.
No valid licenses found.
Click here to fill out an academic license request
for the username and first hostid listed above.

When I conduct academic license request,I meet the condition that Licenses cannot be issued for root or administrator usernames. Please use a different username.

So I want to know how I should do.
Thank you.

That seems like a CVX specific issue. You will have to ask CVX support for help.


The amount of memory rrequired by CVX and whatever solver it calls depends on the type of problem. For example a given size matrix in a Linear Program linear constraint is quite different than an SDP matrix constraint.

Try starting with s small-sizes version of your problem, if you can, and observe how much memory it requires. Then in crease the size and observe what happens. This should give you an indeq how much memory you will require for the full-sized version of the problem.