MATLAB - how to increase memory?

1,232
17
Hello,

I have a problem with my code, it uses too much memory. Aside from optimisation of the code (which I am constantly working on), how can I increase the memory which is available to MATLAB?

Code:
>> memory
Maximum possible array:             435 MB (4.564e+008 bytes) *
Memory available for all arrays:    902 MB (9.463e+008 bytes) **
Memory used by MATLAB:              820 MB (8.601e+008 bytes)
Physical Memory (RAM):             1980 MB (2.076e+009 bytes)

*  Limited by contiguous virtual address space available.
** Limited by virtual address space available.
I understand why RAM is limited, but I can't understand in the help file how I can increase the memory used by MATLAB.

I have three matrices in my workspace, two are about 1 MB and the third is huge (it is a sparse double matrix with 30 million elements), about 255 MB. I am trying to implement an algorithm which uses this matrix, and its transpose, and the code always fails when it needs to use the transpose, presumably because it needs another 255 MB to store the result.

But the memory for all arrays is 920 MB , and I have no array which is larger than 435 MB, so I don't understand what is taking up so much space.

Is there a MATLAB command that I can do which effectively says "ok you are allowed to use 1.5 GB of my 1.98 GB physical memory so do whatever you want? Or if this fails, and I buy more RAM, (and apparently you can use a windows switch to increase the max for any one program from 2 to 3 GB), will it even help my problem?


Thanks for any help,
 

The Physics Forums Way

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top