out of memory error while mutiplying large matrices

조회 수: 8 (최근 30일)
sriharsha
sriharsha 2014년 4월 7일
답변: sriharsha 2014년 4월 8일
I have got two huge matrices dat1=87093*59 and dat2=99802*59. I tried to do following operation R=dat1*dat1' but MATLAB throws me an error ??? Out of memory. Type HELP MEMORY for your options. I have increased Java Heap Memory(by going into file-<preferences) to 2012Mb but still the problem repeats. Can anyone help me out. system config: windows 7-64bit, 8gb ram, matlab:r2010a-32bit version Many thx in advance.

채택된 답변

Youssef  Khmou
Youssef Khmou 2014년 4월 7일
This multiplication goes beyond the limit of Read-Only-Memory, the solution is to use the multiplication per blocks, see the example in this link on how this is performed : http://math.stackexchange.com/questions/30135/multiplication-of-block-matrices
So you need to decompose the matrices A,B into at least 4 blocks and compute structurally each block of C.

추가 답변 (3개)

John D'Errico
John D'Errico 2014년 4월 7일
편집: John D'Errico 2014년 4월 7일
Just wanting to do something extreme is not enough to be able to do it.
The resulting matrix will be 87093x99802 in size,
87093*99802*8/1e9
ans =
69.536
so roughly 70 gigabytes in size.
People think their computers are infinitely large and infinitely fast. Not true. They have limits, and you are trying to go far past those limits here.

Jan
Jan 2014년 4월 7일
Do not increase the Java heap memory only because it contains the term "memory" also. In this case reserving memory for Java increases the problem, because you have less memory for the computations.
On one hand installing much more RAM is the best solution - I'd start at 2*70 GB. Of course this is expensive. On the other hand running a 32-bit version of Matlab is not sufficient.

sriharsha
sriharsha 2014년 4월 8일
hey guys thanks for the replies..I didn't recognize the size of matrix at all..It was utterly my mistake..thought it could be some prob with code or so and completely overlooked my matrix size.. I got it now I will try to get it down. Thanks once again.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by