[SciPy-user] ipython memory leak

Michael.Abshoff michael.abshoff at googlemail.com
Thu Apr 10 13:53:16 EDT 2008


Keflavich wrote:

Hi,

> Hi, I'm running a script that loads a lot of fits images into the
> global namespace; I need at least most of them to be present for
> debugging purposes.  However, every time I re-run the script, it
> consumes exactly the same amount of memory: nothing is freed even
> though all of the variables are overwritten.  I've tried playing with
> the gc module and %clear out and manually deleting the variables, but
> the memory is never freed.  After 2-3 runs, ipython crashes
> complaining of a memory issues.  Plotting with matplotlib may be part
> of the problem, but the memory leak (?) still occurs if I remove the
> plotting commands.  Any tips on cleaning things up?

I have seen similar things with Sage, i.e. if you allocate a matrix and 
do not delete it via del before exit it does not get deallocated despite 
its reference count being one. One the other hand if you you reassign 
that matrix to a different one the now no longer referenced matrix 
object is being deallocated. We are using a rather old ipython release, 
so it might have been fixed upstream. It might also be a bug in our code 
base, but this sounded eerily familiar.

> The memory error:
> python2.5(751) malloc: *** mmap(size=102875136) failed (error code=12)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
> 
> Thanks,
> Adam

Should this be discussed here or what is the general policy to discuss 
ipyhton related issues?

Cheers,

Michael

> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
> 




More information about the SciPy-User mailing list