-1

Whenever i run parfor in matlab, in the task manager I can see the 4 sessions on the quad-core machine taking up a total of only about 2.1GB of memory. Is there any way to increase the memory given to Matlab processes? The same goes for CPU - it does not reach even 50% utilization. I have even tried increaseuservm but same persists.

  • 1
    this is very problem-dependant. The amount of memory/cpu your computer will use is relative to the task you are performing, – Ander Biguri Nov 02 '15 at 00:49

1 Answers1

0

Memory is not given to processes, rather it is requested by the process and then allocated if available. If you are using the 64 bit version of Matlab then it will essentially have access to as much memory as is available in your machine. Matlab is simply not requesting more than 2.1GB so there is nothing that can be done here. What makes you think that using more memory would increase performance anyway?

For CPU utilisation the situation is a bit more complex. Is your machine a true quad-core processor or a dual-core processor with hyper-threading. Most likely it is the latter, which shows up in the Task Manager as having 4 cores, but is actually using clever tricks in the processor to enable two different processes to use the same core at the same time. If you are loading the core very heavily then these tricks cannot be used, so it will appear as 50% utilisation even though you have actually used all the available processing power.

Finally, this is very application dependent. For example, if you are reading or writing to disk a lot (or to a lesser extent memory) then the CPU utilisation may appear lower than you would expect simply because it is waiting for other operations to complete.

In short, there is nothing that can be done on an operating system level to significantly increase the amount of processing that Matlab can do. You can almost always make better gains by optimising your algorithm.

zelanix
  • 3,326
  • 1
  • 25
  • 35
  • In that case, let me rephrase it. How to get the CPU and the memory data usage (and possibly the disk usage) during real-time as the code is running? Is there any way to save this data in a file? – user5461722 Nov 07 '15 at 07:11
  • @user5461722, that is a very different question, but see [this answer](http://stackoverflow.com/a/25953389/2433501) perhaps. – zelanix Nov 07 '15 at 08:24