Out of memory using mldivide \?

4 views (last 30 days)
Puneet
Puneet on 18 Jun 2014
Edited: Matt J on 18 Jun 2014
Hello,
I am trying to solve a over-determined set of equations A*x = b using mldivide function as x = A\b; I am getting out of memory error!! Following is the description of the matrices: A = 19000000 x 4900 but sparse consuming 750MB of space. (have to store two of such matrix) b = 19000000 x 1 but sparse 32 bytes.
I tried this on a system with 16 GB of RAM. It went out of memory. On typing
>>help memory
for 64 bit version MATLAB 2013a (I am using for windows) it shows:
Max. possible array = 4577MB
Memory available for all arrays = 4577MB
Memory used by MATLAB = 330MB
Physical Memory(RAM) = 3327 MB
I believe that there is internal restriction for MATLAB to use memory but I don't know how to go about it?
I tried this problem on a computer with 64GB of memory too and still it goes out of memory!!
Please help!!
Thanks in advance.
Puneet

Accepted Answer

Matt J
Matt J on 18 Jun 2014
Edited: Matt J on 18 Jun 2014
It doesn't look like you have as much RAM as you say you do. In the output of the memory command that you posted, it says you have only 3.3GB RAM, not 16GB. Maybe you are running under 32-bit Windows?
Nevertheless, if the problem is well-conditioned, you can try solving it using the normal equations
x=full(A.'*A)\(A.'*b)
  2 Comments
Puneet
Puneet on 18 Jun 2014
That is my point that although I have 16GB RAM but >>help memory command shows 3.3GB. I am also sure that it is 64 bit environment. I doubt there is some internal setting in MATLAB for memory which I don't know. Your approach is awesome dude. I don't know why it didn't strike to me. Simple mathematics Ax = b; A'A.x = A'.b
Thanks Matt
Thanks Star Strider.
Matt J
Matt J on 18 Jun 2014
Edited: Matt J on 18 Jun 2014
The alternative A'A.x = A'.b is really not ideal. It degrades the conditioning of the equations.
You should talk to Tech Support to find out why you don't have access to more of your RAM. I have only 8GB RAM, and my MATLAB session has access to much more memory,
>> memory
Maximum possible array: 12025 MB (1.261e+10 bytes) *
Memory available for all arrays: 12025 MB (1.261e+10 bytes) *
Memory used by MATLAB: 1778 MB (1.864e+09 bytes)
Physical Memory (RAM): 8073 MB (8.465e+09 bytes)
Even if your OS is 64-bit, possibly you've installed a 32-bit MATLAB version? Anyway, it's worth further investigation.

Sign in to comment.

More Answers (0)

Categories

Find more on Performance and Memory in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!