Message from discussion
Tracking Memory Leaks
From: Guido van Rossum <gu...@CNRI.Reston.Va.US>
Subject: Re: Tracking Memory Leaks
Date: 1998/05/28
Message-ID: <199805281550.LAA01791@eric.CNRI.Reston.Va.US>#1/1
X-Deja-AN: 357589261
Sender: dae...@cwi.nl (0000-Admin(0000))
References: <Pine.SGI.3.96.980528110505.17935L-100000@lemur.magnet.com>
Organization: CWI, Amsterdam
Newsgroups: comp.lang.python
> Does anyone have any tips for tracking down memory leaks? I have a
> long-running application (an ad server) which gains 40M in a few hours
> under moderate load.
If you recompile all of Python with Py_TRACE_REFS defined, it can
print a list of all objects (not just the ones that are easily
accessible through modules) and their reference counts at the end of
the run. The disadvantage is that this only gives you their types,
not their name; the other side of this coin is that it finds nameless
leakage.
--Guido van Rossum (home page: http://www.python.org/~guido/)