Out of memory error with 8GB and 64bit
Show older comments
Hi,
I am working with lots of memory and I am getting an out of memory error.
>> memory
Maximum possible array: 16146 MB (1.693e+10 bytes) *
Memory available for all arrays: 16146 MB (1.693e+10 bytes) *
Memory used by MATLAB: 1080 MB (1.132e+09 bytes)
Physical Memory (RAM): 8111 MB (8.505e+09 bytes)
* Limited by System Memory (physical + swap file) available.
The model is quite large. It's a script with dozens of matrixes 50k*50k. I know I use intensive functions as copulas, kron function, nested for and if's.
But this model is being developed for a long time and I really need it to run. What can I do?
Am I being inefficient or am I simply asking the impossible? This is a 64bit version.
Thanks a lot,
4 Comments
Walter Roberson
on 29 Oct 2015
Can you switch the large arrays to single precision, so they use half as much memory?
Alexandra
on 30 Oct 2015
So named "single" floating point values take up exactly half the memory of "double" floating point values, but have a lower precision, exactly as the documentation states "Because MATLAB stores numbers of type single using 32 bits, they require less memory than numbers of type double, which use 64 bits. However, because they are stored with fewer bits, numbers of type single are represented to less precision than numbers of type double."
Converting to single would be an easy way to use less memory, if the precision requirement of your algorithm and data permit this.
Alexandra
on 30 Oct 2015
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!