Thread Subject: out of memory, swap space not used

Subject: out of memory, swap space not used

From: craq

Date: 22 Jul, 2009 16:06:01

Message: 1 of 5

Hi,
I am using the spectogram function, which in combination with the images it produces requires a fair amount of RAM. Theoretically, I have enough virtual memory, but not enough RAM. Is there any way to force Matlab to use swap space? Having it run slowly would be better than not at all!

My system is Ubuntu 9.04 with Matlab 7.3.0.298 (R2006b). I've added vm.swappiness=80 to /etc/sysctl.conf, but haven't noticed any difference yet.

a@b:/$ free
                            total used free shared buffers cached
Mem: 2043800 1833080 210720 0 4596 334152
-/+ buffers/cache: 1494332 549468
Swap: 5855684 315780 5539904

Thanks

Subject: out of memory, swap space not used

From: Stan Bischof

Date: 22 Jul, 2009 16:12:00

Message: 2 of 5

craq <chris.rapson@ipp.mpg.de> wrote:
> Hi,
> I am using the spectogram function, which in combination with
>the images it produces requires a fair amount of RAM.
>Theoretically, I have enough virtual memory, but not enough RAM.

How big is your Matlab process getting? You probably have
32-bit code/32 bit OS which says that no matter what you do the
process size will be limited to somewhere around 2-4 GB
( actual limit depends upon how it is compiled-- 2GB
limit is common ).

Stan

Subject: out of memory, swap space not used

From: nor ki

Date: 23 Jul, 2009 07:22:02

Message: 3 of 5

"craq " <chris.rapson@ipp.mpg.de> wrote in message <h47dd9$o5g$1@fred.mathworks.com>...
> Hi,
> I am using the spectogram function, which in combination with the images it produces requires a fair amount of RAM. Theoretically, I have enough virtual memory, but not enough RAM. Is there any way to force Matlab to use swap space? Having it run slowly would be better than not at all!
>
> My system is Ubuntu 9.04 with Matlab 7.3.0.298 (R2006b). I've added vm.swappiness=80 to /etc/sysctl.conf, but haven't noticed any difference yet.
>
> a@b:/$ free
> total used free shared buffers cached
> Mem: 2043800 1833080 210720 0 4596 334152
> -/+ buffers/cache: 1494332 549468
> Swap: 5855684 315780 5539904
>
> Thanks

Hi Craq,

help pack
help memory

do you use double precision and really need it?

hth
kinor

Subject: out of memory, swap space not used

From: craq

Date: 23 Jul, 2009 14:19:01

Message: 4 of 5

Thanks for the replies. I don't have the option to use a 64 bit system at the moment, but it might be useful in the future. The Matlab process was getting pretty close to 2GB, how would I check what the maximum process size is, and is it possible to change this after compilation?

I'd tried packing, and deleting all unnecessary variables. I should probably look at my variable types, but until now I've been too lazy.

I found out that the real problem was the extremely high resolution I was asking from the spectogram function, which was replicated several times in temporary variables inside the function.

Subject: out of memory, swap space not used

From: Stan Bischof

Date: 23 Jul, 2009 14:32:55

Message: 5 of 5

craq <chris.rapson@ipp.mpg.de> wrote:
> Thanks for the replies. I don't have the option to use a
>64 bit system at the moment, but it might be useful in the
>future. The Matlab process was getting pretty close to 2GB,
> how would I check what the maximum process size is, and

one simple way is to increase the process size
by allocating memory ( growing a matrix would work fine )
until you get "out of memory". Of course be watching the
process size.

You could also ask Mathworks about your code/OS- they
should know max size

> is it possible to change this after compilation?

almost certainly no.

>
> I found out that the real problem was the extremely
>high resolution I was asking from the spectogram
>function, which was replicated several
>times in temporary variables inside the function.

If you can't go 64-bits then your only choice is
to make your program smaller by allocating less
space. Sounds like you have this under control
so you are probably good to go.

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
out of memory craq 22 Jul, 2009 12:09:05
swap craq 22 Jul, 2009 12:09:05
rssFeed for this Thread

Contact us at files@mathworks.com