[issue9417] Declaring a class creates circular references

Kristján Valur Jónsson report at bugs.python.org
Thu Jul 29 21:22:40 CEST 2010


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

Interesting.  Here is a case for disabling GC:  

We intentionally disable GC in Eve-online, because of the unpredictable lag spikes it produces.  In a server application with gigabytes of python objects, GC can cause hickups of some seconds, which is unacceptable when trying to keep the latency low.

We were considering using Django for our backend web framework once.  Good that we didn't, since it would have leaked.

We do try to keep our code free from circular references, and occasionally run single GC passes on our test cluster to weed out any that may have formed accidentally (gc.garbage with DEBUG_LEAKS)

IMHO, python should try to be as free from these as possible, although it is admittedly not always easy (see recursive closures, issue 7464)

An alternative, is to do something like the minidom module does:  Provide a "unlink" method (or similar) to manually nerf objects before forgetting them.  Perhaps this could be standardized with an unlink keyword and a __unlink__ special method?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9417>
_______________________________________


More information about the Python-bugs-list mailing list