How to solve memory problem - How to increase memory and max array length?

1 view (last 30 days)
Hi,
I have HDF files of Chlorophyll data. I am trying to process these HDF4 files to generate NDVI for the period. but when I try to execute
Band = hdfread('F:\MATLAB\HDF data\binned hdf\OCMHDFFiles_20-Sep-2012\O2_01APR2011_004_000_GAN_L3B_CL_M.hdf','clo','Fields','');
% Construct an RGB matrix from the three bands into one 3D matrix.
SPCrater_321 = cat(Band);
% Display the image
figure(1)
imshow(SPCrater_321)
xlabel('Longitude (pixels)')
ylabel('Latitude (pixels)')
title('ASTER Bands 3, 2, 1')
??? Error using ==> permute
Out of memory. Type HELP MEMORY for your options.
Error in ==> hdfsdsread at 57
data = permute(data,ndims(data):-1:1);
Error in ==> hdfread at 240
varargout{1} = hdfsdsread(hinfo,start,stride,edge);
Next execution is,
Band_3 = hdfread('F:\MATLAB\HDF data\binned hdf\OCMHDFFiles_20-Sep-2012\O2_01APR2011_004_000_GAN_L3B_CL_M.hdf','clo','Fields','ImageData3N');
Band_2 = hdfread('F:\MATLAB\HDF data\binned hdf\OCMHDFFiles_20-Sep-2012\O2_01APR2011_004_000_GAN_L3B_CL_M.hdf','clo','Fields','ImageData2');
Band_1 = hdfread('F:\MATLAB\HDF data\binned hdf\OCMHDFFiles_20-Sep-2012\O2_01APR2011_004_000_GAN_L3B_CL_M.hdf','clo','Fields','ImageData1');
% Calculate NDVI.
Band_2 = im2single(Band_2);
Band_3 = im2single(Band_3);
SPCrater_NDVI = (Band_3 - Band_2) ./ (Band_3 + Band_2);
% Display the image.
j=imresize(SPCrater_NDVI,0.5);
figure(5)
imshow(j,'DisplayRange',[0 1])
??? Out of memory. Type HELP MEMORY for your options.
And this is what I get when I type the 'memory' command at this point of execution:
memory
Maximum possible array: 255 MB (2.669e+008 bytes) *
Memory available for all arrays: 569 MB (5.971e+008 bytes) **
Memory used by MATLAB: 1197 MB (1.255e+009 bytes)
Physical Memory (RAM): 8181 MB (8.578e+009 bytes)
* Limited by contiguous virtual address space available.
** Limited by virtual address space available.
can anyone please help me to solve this problem. how to increase the length of the memory array.
Advance thanks
M. Prabu
(maprabu)
  4 Comments
Walter Roberson
Walter Roberson on 14 Dec 2012
The 32 bit version of MATLAB can only access about 3 gigabytes of memory, including the space for MATLAB itself, but excluding space for the operating system.
The 64 bit version of MATLAB can, in effect, access all the physical memory you have on the system (8 gigabytes in your case.) It is not technically unlimited memory, but if you have 4 petabytes of RAM on your system then you probably have a line-up of people wanting to use your computer :)

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!