How to increase memory and max array length!?
14 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm trying to process MRI images in MATLAB, but when I try to execute this line:
T1_h = h1_aux'*ones(1,2^16);
where h1_aux is (2^16,1) so that the result T1_h should be a [2^16 x 2^16] 'double' matrix, MATLAB runs out of memory:
??? Out of memory. Type HELP MEMORY for your options.
since the number of elements in largest real double array is 2^{48}-1 (~2.8e14) for mi 64-bit Windows 7 running 64-bit MATLAB R2010b
And this is what I get when I type the 'memory' command at this point of execution:
>> memory
Maximum possible array: 12297 MB (1.289e+010 bytes) *
Memory available for all arrays: 12297 MB (1.289e+010 bytes) *
Memory used by MATLAB: 973 MB (1.020e+009 bytes)
Physical Memory (RAM): 8173 MB (8.570e+009 bytes)
* Limited by System Memory (physical + swap file) available.
Due to the algorithm that I'm implementing, I cannot break this matrix into smaller ones to process them separately.
How can I increase the memory to increase the length of the arrays and avoid this message?
Thank you.
Angel TC.
0 个评论
采纳的回答
Jonathan Sullivan
2012-3-26
Buy more RAM. By my calculation, a 2^16x2^16 matrix of doubles would require 32 GB of RAM. Chances are you'll be making at least 1 more matrix during you computations that is this size. And in some additional RAM for your system to use, and your are talking ~68 GB of RAM.
0 个评论
更多回答(3 个)
Walter Roberson
2012-3-26
The array you are trying to build is 2^35 bytes, which is 32 gigabytes. If you can't go sparse for it, you need to add more physical memory or more swap space.
0 个评论
Keita Ikeda
2015-2-12
I have the same problem.
I have a vector: 125001408x1 int16 which is about 250 MB
I have 48 GB of physical RAM: >> memory Maximum possible array: 42866 MB (4.495e+10 bytes) * Memory available for all arrays: 42866 MB (4.495e+10 bytes) * Memory used by MATLAB: 1671 MB (1.752e+09 bytes) Physical Memory (RAM): 49143 MB (5.153e+10 bytes)
- Limited by System Memory (physical + swap file) available.
As you can see, I am nowhere close to using my Physical Memory (RAM). If I try to see the vector in Workspace, I get:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
and I can't plot it or even look at it. How may I increase this "Java heap space?"
Thank you in advance, Keita
0 个评论
Imran Muhammad
2017-10-27
>> memory Maximum possible array: 745 MB (7.809e+08 bytes) *
Memory available for all arrays: 1310 MB (1.374e+09 bytes)
Memory used by MATLAB: 426 MB (4.467e+08 bytes)
Physical Memory (RAM): 2954 MB (3.097e+09 bytes)
- Limited by contiguous virtual address space available.
Limited by virtual address space available. >>
how can i increase maximum possible array memory?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!