[SciPy-user] [novak@ucolick.org: Re: integrate.odeint]

Ed Rahn ed at lamedomain.net
Fri Oct 15 14:22:06 CDT 2004

Hi Greg,
Are you taking care of freeing memory in the C code? Python knows nothing about the memory being allocated in it, it's garbage collection and would not be applicable here.


On Fri, 15 Oct 2004 12:04:05 -0700
Greg Novak <novak at ucolick.org> wrote:

> I have an extremely unfocused question.  
> I've written a bit of code that uses scipy to compute Lyapunov
> exponents for a particular dynamical system.  The only subtlety
> (mentioned in a recent e-mail) is that I don't use integrate.odeint()
> but rather my own home-brew routine that functions like odeint, but
> instead of taking a python function it takes a string with C code that
> it compiles (along with an ode integrator from Numerical Recipes) with
> Weave so that the whole integration happens in C rather than calling
> back and forth between C/Fortran and Python.
> Here's the problem: while running last night, this program managed to
> fill 2 GB of memory and crash.  There's no way that 2 GB of memory was
> required at any given time, so it must be leaking.  
> This is my first real effort in Python, so facing this problem I feel
> a bit like a babe in the forest.  Python has garbage collection and
> therefore memory leaks must be buried in the "inner workings" of the
> langauge. 
> Therefore, I'm soliciting advice from the wise men and women of the
> scipy/python community: what's your strategy for tracking down bugs
> like this?  What sorts of bugs are typical?  If I were using the
> C/Python API directly, I would conclude that I'd messed up reference
> counts.  But the reference counting increment/decrement macros don't
> appear when you use Weave.
> So, that's it.  Any advice is welcome.
> Greg
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user

More information about the SciPy-user mailing list