How do I begin debugging a python memory leak?

Diez B. Roggisch deets at nospam.web.de
Wed Sep 16 20:18:49 EDT 2009


Matthew Wilson schrieb:
> I have a web app based on TurboGears 1.0.  In the last few days, as
> traffic and usage has picked up, I noticed that the app went from using
> 4% of my total memory all the way up to 50%.
> 
> I suspect I'm loading data from the database and somehow preventing
> garbage collection.
> 
> Are there any tools that might help me out with this?

Maybe this one:

  http://packages.python.org/Pympler/

Haven't used it myself so far though. I also have good experiences with 
using the module gc & calculating histograms of instance-counts.

Diez



More information about the Python-list mailing list