[SciPy-user] [SciPy-dev] Memory usage of scipy.io.loadmat

Ariel Rokem arokem at berkeley.edu
Tue Jun 30 19:24:57 EDT 2009


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









On Tue, Jun 30, 2009 at 3:33 PM, Xavier Saint-Mleux <saintmlx at apstat.com>wrote:

>
> >
> > 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 is probably just the garbage collector being invoked.  If you invoke
> it manually, does it always free memory? e.g.:
>
> import gc
>
> gc.collect()
>
>
>
> Xavier Saint-Mleux
>
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>



-- 
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090630/cac9f825/attachment.html>


More information about the SciPy-User mailing list