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

Greg Novak novak at ucolick.org
Fri Oct 15 14:04:05 CDT 2004

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

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.


More information about the SciPy-user mailing list