Increase memory used by Matlab

I have Windows 7 (64 bits) and I would like to increase the performance of Matlab (version R2011b). I would like to know how to configure Windows to let Matlab to use more memory, because I think 513MB of 24GB is too low. The memory state is as follows:
<<
Maximum possible array: 45917 MB (4.815e+010 bytes) *
Memory available for all arrays: 45917 MB (4.815e+010 bytes) *
Memory used by MATLAB: 513 MB (5.382e+008 bytes)
Physical Memory (RAM): 24574 MB (2.577e+010 bytes)
* Limited by System Memory (physical + swap file) available.
>>
Can anyone help me?
Thank you very much in advance.
Gil

2 Comments

Hi, Gil
May I know how to increase the memory size like you did?
Physical Memory (RAM): 24574 MB (2.577e+010 bytes)
Did you reset the virtual memory or just buy extra memory?
Many thanks in advance.
Best wishes Wenlong
Hi, can I ask you how did you manage to have such a big Maximum possible array size?
Thank you

Sign in to comment.

 Accepted Answer

Jan
Jan on 15 Mar 2012
The 513 MB means the currently used memory. This is increased automatically, when you define new arrays. "Memory available for all arrays: 45917 MB" seems like you are using a large virtual memory block, because you have installed 24 GB only.

6 Comments

Thank you for your answer. But I would like to know how to increase this 513MB. I have to solve an optimization problem and it takes 1 hour, the same as with a computer that has Windows XP, 32 bits and only 4GB RAM.
I wondered if increasing the memory that Matlab can use, the resolution would be faster.
Do you think that the problem is this low memory RAM used? How I could increase the velocity?
Thank you very much,
Gil
It sounds like your problem is gated by CPU speed and not memory utilization. As Jan says, MATLAB will consume more memory as it needs it. It sounds like your system has 24 GB or RAM and about the same amount of swap (aka virtual memory) configured, but I'll bet if you look at the task manager the virtual memory use is low and/or nonexistent.
Have you tried profiling your code to see where the most time is taken? Perhaps there are ways of coding that could reduce your computation time. I've seen some people post code here that folks like Jan, Walter, etc have commented on and come up with more efficient ways of doing something.
I have seen that task manager says that memory used is 282700KB, and it remains there, with less than 5% of CPU used. I don't know if it is memory utilization or CPU problem, but I think that I could increase the performance, but I don't know how.
Do you have any idea? Thank you very very much.
Gil
@Gil: Matlab increases the memory automatically on demand. E.g. a "X=zeros(1000)" will increase the memory usage - most likely. You do not have to do this manually.
There is only one possible advice for increasing the speed as long as you do not post the relevant parts of the code: Use a faster computer.
But is is very likely that improvements of the code will be much more efficient than investing money for a new computer.
So if the memory used is only 282MB and the CPU is idling, I would guess that you are doing something else that is limiting the speed of execution -- are you reading a file from a disk or network?
But as Jan says, this quickly becomes a guessing game without knowing what is going on in the code.
Hi, I'm having the same problem as above, and I know it's because my script is written very badly. Would you mind helping me out with this? The piece of code taking hours and hours to calculate is:
Fr = zeros(length(omega_interp),t_end);
Fi = zeros(length(omega_interp),t_end);
for t = 1:t_end;
for i=1 : length(omega_interp);
for j = i+1 : length(omega_interp);
Fr(i,t) = Fr(i,t) + 2*sum(Amp(i)*Amp(j).*(QTFREAL_Final(i,j)+QTFREAL_Final(j,i)) .* cos(((omega_interp(i)-omega_interp(j))*t)+(eps(i)-eps(j))));
end
end
end
end
So what I want to do is compute (Second order wave drift forces) over time (thats the first for loop), over varying frequency (hence the two for loops in my script). I know matlab is better with matrices, however, i get a bit lost with the cos((omega(i)-omega(j))*t)

Sign in to comment.

More Answers (1)

If memory is available and MATLAB can benefit from it, MATLAB will uses it. When MATLAB doesn't need the memory anymore, it gives it back. You can see this with:
memory
Memory used by MATLAB: 262 MB (2.747e+008 bytes)
x = randn(1e8, 1); % This is all my poor little Windows box can handle
memory
Memory used by MATLAB: 1025 MB (1.075e+009 bytes)

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Asked:

Gil
on 15 Mar 2012

Commented:

on 23 Nov 2014

Community Treasure Hunt

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

Start Hunting!