필터 지우기
필터 지우기

How to increase memory and max array length!?

조회 수: 7 (최근 30일)
Angel Torrado-Carvajal
Angel Torrado-Carvajal 2012년 3월 26일
답변: Imran Muhammad 2017년 10월 27일
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.

채택된 답변

Jonathan Sullivan
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.

추가 답변 (3개)

Walter Roberson
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.

Keita Ikeda
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

Imran Muhammad
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?

카테고리

Help CenterFile Exchange에서 MRI에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by