Tracking memory leaks

Jonathan M. Gilligan jonathan.gilligan at vanderbilt.edu
Tue Nov 13 15:25:41 EST 2001


I have problems with an application that makes heavy use of Numeric and
calldll. The problem is that it leaks memory like a seive (at each iteration
of a loop in which large Numeric arrays are created and (I hope) destroyed,
python's memory use skyrockets. I have invoked gc.set_debug and there are no
unreachable objects, but the third-generation object store gets bigger and
bigger each time through the loop.

I am sure that the problem is with my code, not with the core of Python or
Numpy, but I would really like to get to the bottom of this. Is there any
good way for me to get python to dump a list of all the Python objects in
existence? I have no way right now to tell what objects are taking up so
much room on the heap and if I could get the garbage collector or something
else to give me a snapshot of what types all the active objects are, it
would be a tremendous help. If I could trace allocation and freeing to
stderr, it would be even better!

I am using Active State python 2.1.1 (#20, Jul 26 2001, 11:38:51) under
Windows NT 4.0 SP 6a.

Thanks for any help or pointers.

Jonathan





More information about the Python-list mailing list