Thread Subject: Memory issues

Subject: Memory issues

From: Rajgopal

Date: 15 Aug, 2009 21:04:03

Message: 1 of 1

Hi everyone,

I need to optimize my code for memory since I seem to be running out of it..So I'm using the memory option of the profile to get an idea of the memory usage...

I'm having trouble decoding what the output actually means..

  20.94 20428000 8.52g/0b/448b 292 xcovar(rowt,colt)=1;


So this one line of code takes 20.94 seconds when called twenty million times. xcovar is an 8*8 matrix (xcovar = zeros(8,8)). Strange..

But anyways, the next 3 nos are supposed to mean Allocated Memory/Peak Memory/Memory Freed. Does that mean this line of code is allocated 8.52g memory? How do I read the output...What I would hope for is that Matlab just allocates and reuses the 64 bytes..maybe more for the double.

Also what would be the best way to reinitialize a 3D array of matrices to 0, without creating additional temporary storage...

Any ideas?

Thanks,
Raj

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 Rajgopal 15 Aug, 2009 17:09:04
rssFeed for this Thread

Contact us at files@mathworks.com