Yes - that does seem to free up the memory.
While running this:
In [11]: for i in range(10):
a = sio.loadmat('/Users/arokem/Projects/SchizoSpread/Scans/SMR033109_MC/Gray/Original/TSeries/Scan1/tSeries1.mat')
causes a memory error, running this:
In [14]: for i in range(10):
a = sio.loadmat('/Users/arokem/Projects/SchizoSpread/Scans/SMR033109_MC/Gray/Original/TSeries/Scan1/tSeries1.mat')
gc.collect()
seems like it could go on forever (looking at the memory usage on a memory monitor, it just goes up and down to the same point, without net accumulation).
Thanks a lot!
Ariel
It is probably just the garbage collector being invoked. If you invoke
>
> So - just invoking an error in the ipython command line has freed up
> 300 MB. Where did they come from? I tried different things - assigning
> other variables doesn't seem to free up this memory. Neither do calls
> to other functions. Except "plot()", which does seem to do the trick
> for some reason. Interestingly, when I run all this in a python
> interactive session (and not ipython), I get a similar memory usage
> initially. Calling a non-existent variable does not free up the
> memory, but other things do. For example, import matplotlib.pylab into
> the namespace did the trick. Does anyone have any idea what is going on?
>
it manually, does it always free memory? e.g.:
import gc
gc.collect()
Xavier Saint-Mleux
_______________________________________________
Scipy-dev mailing list
Scipy-dev@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev