out of memory error while mutiplying large matrices
조회 수: 8 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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.
댓글 수: 0
추가 답변 (3개)
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.
댓글 수: 0
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!