[Python-Dev] recursive closures - reference leak

Maciej Fijalkowski fijall at gmail.com
Tue Dec 8 15:58:13 CET 2009

> Ah, yes.  In my particular case, I'm running a cluster of hundreds of nodes, supporting 50.000 players in a real-time space simulation.  We disable GC because of its unpredictable performance impact and are careful to avoid reference cycles.  We use gc from time to time to _find_ those cases that our programmers have missed, and fix them.  This is how I stumbled upon this particular reference cycle that even a high level programmer would not have expected to have created.  This is, IMHO the best use you can make of "gc":  Help you code well, not let you cope with sloppy code :)
> K

Then it is a bit your fault. There is nothing particularly wrong with
creating reference cycles (ie you can't avoid having a gc running in
Java or Jython or anything else basically). Note that disabling gc
does not mean that you will not have unpredictable pauses. Consider
for example that if you loose a reference to a very long chain of
objects, you can have arbitrarily many frees being called before
anything else can happen.


More information about the Python-Dev mailing list