Thread Subject:
Problem with Matlab's memory usage

Subject: Problem with Matlab's memory usage

From: Deanna

Date: 4 Jun, 2009 20:14:02

Message: 1 of 2

I have a problem with Matlab's memory usage. I'm executing a script that runs this process 294272 times: read some .mat files (between 0.5 and 2 Mb each), works with 251x251 double matrices and computes variables. The problem is that the program takes about 30 hours to finish. When I check my system monitor while the script is been executed, it says that Matlab uses less than 1 Gb of my ram (there are 3 Gbs free). The 2 processors oscillate between 40% and 60% of capacity, and my swap is not used at all.

How can I make Matlab use all my computer resources? Is there a way to make Matlab use all the RAM available?
How can I make Matlab use both processors at full capacity?

Computer characteristics
Processor: Intel Core 2 Duo T5750 - 2.0 GHz
Memory: 4 Gb RAM (5 Gb swap)
OS: Ubunutu Hardy Heron 8.04 (kernel 2.6.24-24) 64-bit version
Hard Drive: 250 GB, SATA 1.5 Gb/s, 8 MB Cache, 5400 RPM
Matlab 7.7.0 (R2008b) 64-bit version

Subject: Problem with Matlab's memory usage

From: Stan Bischof

Date: 4 Jun, 2009 21:07:05

Message: 2 of 2

Deanna <dbeirne@ece.neu.edu> wrote:
> I have a problem with Matlab's memory usage.
> I'm executing a script that runs this process 294272 times: read some .mat files (between
0.5 and 2 Mb each), works with 251x251 double matrices and computes variables.
>The problem is that the program takes about 30 hours to finish. When I check my system
>monitor while the script is been executed, it says that Matlab uses
> less than 1 Gb of my ram(there are 3 Gbs free). The 2 processors oscillate between
> 40% and 60% of capacity, and my swap is not used at all.
>
> How can I make Matlab use all my computer resources?
> Is there a way to make Matlab use all the RAM available?
>

Umm, solve a larger problem?
if your Matlab process only gets to 1GB and never goes into swap, then that's
just how much RAM it needs to solve that size problem.


> How can I make Matlab use both processors at full capacity?
>

Much harder question. You could try "nice" ing the process
to make sure that it gets priority. That would tell you if
you can get more cycles.

Likely this won't help much and you'll find that you aren't
CPU bound but rather IO bound, in which case you need to
recode your algorithm.

for instance if you are reading 294272 separate times from your
disk you may find it much faster to read fewer times- i.e.
read say 1000 matrices at a time then operate on them.

Bottom line- you need to profile your code and see where the
time is being used.

Stan

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
memory Deanna 4 Jun, 2009 16:19:04
rssFeed for this Thread

Contact us