python gc performance in large apps

Paul Rubin http
Sat Nov 5 02:02:28 CET 2005


Robby Dermody <robbyd at u20.org> writes:
> t = 120 seconds (1st run after being fully initialized):
> 	list alloced: 2394620, freed: 17565, max in use: 2377056
> 	dict alloced: 2447968, freed: 67999, max in use: 2379969

This looks like a garden variety memory leak.  I think the next thing
to do is to run Python under gdb and sut a breakpoint in the allocator
that saves a stack trace at every list or dict allocation and then
continues, or alternatively put some code into the interpreter itself
to do that.  You'll probably find that all these leaked allocations
are coming from the same place and you're forgetting to DECREF something.



More information about the Python-list mailing list