how do I find memory leaks?

Stidolph, David stidolph at origin.ea.com
Thu Jul 22 18:00:57 EDT 1999


I posted a module called Debug to track down memory leaks.  It requires
specific code be added to your __init__ and __del__ routines, as well as
having a Destroy method we use to eliminate circular references.  If you
want it I will post it again.

-----Original Message-----
From: Greg Ewing [mailto:greg.ewing at compaq.com]
Sent: Thursday, July 22, 1999 4:04 PM
To: python-list at cwi.nl
Subject: Re: how do I find memory leaks?


"Heather A. Drury" wrote:
> 
> I thought using python/vtk
> would take care of all this memory garbage for me

A reasonable expectation, but unfortunately Python
doesn't quite deliver. Garbage collection in Python
is by reference counting only, so if there are any
cycles in your garbage, it never goes away.

You have to design your program so that it either
doesn't create any cycles or ensures that they are
broken when the data is no longer needed.

There was a module called Cyclops announced here
by Tim Peters recently for finding cycles in data 
structures. Take a look back in dejanews.

Greg




More information about the Python-list mailing list