mldivide out of memory with 6000x6000 matrix

15 views (last 30 days)
Lucas
Lucas on 18 Jan 2013
Hello,
I have a linear system with a full 6000x6000 complex matrix (elements with real and non-zero imaginary parts). When I try to solve the system using mldivide or the "\" operator, the message "out of memory" appears. In this case, the required memory amount to store the matrix is 16(8 Bytes for real part and 8 Bytes for imaginary part) x 6000x6000 = 576 MB.
Since I have 3.8 GB of free memory, I thought that this amount of memory would be enough to solve the system. However the "out of memory" error appears.
Then, I try to run the calculation in a computer with 6 GB of free RAM, but the error "out of memory" appears again!!
Therefore, I should conclude that there is an intrinsic limit in the mldivide function. I found Matlab doesn´t have problem in allocating the matrix in memory when enough RAM is available, but mldivide and functions for LU decomposition and matrix inversion do not work despite having enough memory.
I wonder if anyone else has encountered this same problem
Thanks
  3 Comments
Jason Ross
Jason Ross on 18 Jan 2013
Just to be clear, you are running a 64-bit MATLAB on a 64-bit operating system? What version of MATLAB?
James Tursa
James Tursa on 18 Jan 2013
Edited: James Tursa on 18 Jan 2013
FYI, for complex matrices MATLAB holds the real part in one contiguous block and the imaginary part in another separate contiguous block. But the BLAS and LAPACK routines that manipulate complex matrices (e.g., for linear equation solving) require the complex matrices to be held in a single contiguous block in interleaved fashion (ala Fortran and C/C++). Bottom line is there is typically going to be a "copy in copy out" process for your data to convert to/from the required format, and on top of that is the temporary storage for similarly sized work arrays.

Sign in to comment.

Answers (1)

Ken Atwell
Ken Atwell on 18 Jan 2013
If you are on Windows (64-bit, presumably -- what does COMPUTER return?), the MEMORY command could give you clues as to what is going on. What does this command report back? I'm not aware of LU et al having an intrinsic limit.

Community Treasure Hunt

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

Start Hunting!