|
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
|