From: yusuf awal on
I have 3 dimension data A=<1500x360x720> in netcdf format. Then the message 'error Out of memory. Type HELP MEMORY for your options' occurs when I trying to retrieve all data. However when it does work when I extracted only A=<100x360x720> data. Then I changed my PC's memory (2G), but I found the similar results.
Could anybody helped me out of this issue?

thanks

yus
From: Steven Lord on

"yusuf awal" <awaludinium(a)yahoo.com> wrote in message
news:hsiuua$kuu$1(a)fred.mathworks.com...
>I have 3 dimension data A=<1500x360x720> in netcdf format. Then the message
>'error Out of memory. Type HELP MEMORY for your options' occurs when I
>trying to retrieve all data. However when it does work when I extracted
>only A=<100x360x720> data. Then I changed my PC's memory (2G), but I found
>the similar results. Could anybody helped me out of this issue?

A 1500-by-360-by-720 full array of real double precision values in MATLAB
requires:

>> numElements = 1500*360*720;
>> numBytes = 8*numElements;
>> GB = numBytes/(1024^3)

GB =

2.8968

almost 3 GB of contiguous memory just to store. You'll need additional
contiguous blocks of memory to store temporary copies if you want to
actually _do_ something with that array. If you're on a 32-bit OS you're
not going to be able to obtain that much memory. Even on a 64-bit OS, using
a 64-bit version of MATLAB, if your memory is fragmented or you have
additional arrays in memory, it could be tough getting that large a block of
contiguous memory. Read the following document for some background on
memory management in MATLAB.

http://www.mathworks.com/support/tech-notes/1100/1106.html

I think your best solution is going to be to find some way to read your data
in "chunks" and process each chunk sequentially.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ