python slowdown after a longish time of running (garbage collector)

Oren Tirosh oren-py-l at hishome.net
Sun Sep 1 02:19:38 EDT 2002


On Sun, Sep 01, 2002 at 12:49:29AM +0000, Mahesh Padmanabhan wrote:
> I don't know how GC is implemented in Python, but GC by its very
> can only guarantee that it will close the socket eventually - it
> cannot guarantee *when*.

The GC is implementation-dependent. For Jython it uses the garbage collector 
of the underlying JVM.  CPython uses a combination of reference counting and 
cycle garbage collection.

In CPython the reference counting means that unless you create a cyclic
reference an object will be garbage-collected immediately when there are no 
more references to it.  It is unportable to rely on this behavior but 
apparently many programmers do.

	Oren




More information about the Python-list mailing list