Out of memory error
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi, When I'm trying to multiply a [112880x10] matrix with another matrix of [10x125000], I get an error message "Out of memory". Is there a way of getting around this problem (using special algorithms or similar)?
Answers (1)
Andreas Goser
on 25 Feb 2016
0 votes
One double has 2 bytes.
So the 112880x10 matrix has 2257600 bytes. Fine 10x125000 -> 2500000 bytes. Also Fine
But multiplying should give a 112880x125000 matrix! That is 2.8220e+10 bytes == 26 Gigabytes! Nut sure if this works, but is definitely a challenge. Maybe you are happy with singles too? Also I assume you have a 64 Bit MATLAB on 64 bit OS? You might want to test with slightly smaller matrices where the limit is.
3 Comments
Andreas Goser
on 25 Feb 2016
Edited: Andreas Goser
on 25 Feb 2016
This test script with a tenth of the size runs 140s for me:
clc
size_B=12500; %125000
A=rand(112880,10);
B=rand(10,size_B);
tic
C=A*B;
toc
whos C
nilsotto
on 25 Feb 2016
Walter Roberson
on 25 Feb 2016
Triangularization does not reduce the amount of memory required for the final matrix, and that is your problem rather than "working memory" to do the calculation in.
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!