Plugging a pseudo-memory leak

Adam Atlas adam at atlas.st
Wed Jul 4 03:59:31 CEST 2007


I have a program that seemed to be leaking memory, but after
debugging, it seemed it just wasn't getting around to collecting the
objects in question often enough. The objects are very long-lived, so
they probably end up in generation 2, and don't get collected for a
long time. Is there any way I can force collection of these objects? I
know in Python 2.5 there's gc.collect(2), but I want to keep it
compatible with previous versions of Python.




More information about the Python-list mailing list