From: kiran kumar on
Hi All,
When I'm allocating 1088092 * 300 matrix. I'm getting "Out of memory. Type HELP MEMORY for your options." error.
i.e size of my matrix is 1088092 * 300 * 8 = 2.6114e+09.
How can I increase the maximum size of the matrix that I can allocate in matlab..?

My system config is

Matlab version :- Version 7.8.0.347 (R2009a) 32-bit (glnx86)
OS :- Fedora 11
Ram size :- 2 GB
swap size :- 4.9 GB
My processor is 32-bit architecture.

Thanks in advance.
From: Walter Roberson on
kiran kumar wrote:
> Hi All,
> When I'm allocating 1088092 * 300 matrix. I'm getting "Out of
> memory. Type HELP MEMORY for your options." error. i.e size of my matrix
> is 1088092 * 300 * 8 = 2.6114e+09. How can I increase the maximum size
> of the matrix that I can allocate in matlab..?
>
> My system config is
> Matlab version :- Version 7.8.0.347 (R2009a) 32-bit (glnx86)
> OS :- Fedora 11
> Ram size :- 2 GB
> swap size :- 4.9 GB
> My processor is 32-bit architecture.

You will not be able to increase the maximum matrix size in that
configuration.

On the other hand, you should be able to get somewhere much closer to
500Mb for a matrix. I suspect that if you were to just go in to Matlab
and were to try using zeros() to allocate a matrix that big, that it
would work. I think you are running out of memory due to having other
objects in memory already. It is even possible that you have enough
total free memory but that the memory is not contiguous: if so, then
allocating your big array _first_ would help. Allocating your arrays in
decreasing order of size is the best way to reduce running out of memory
due to memory fragmentation.