[Python-Dev] recursive closures - reference leak

Kristján Valur Jónsson kristjan at ccpgames.com
Tue Dec 8 15:44:21 CET 2009

> -----Original Message-----
> From: Hrvoje Niksic [mailto:hrvoje.niksic at avl.com]
> Sent: 8. desember 2009 13:52
> To: Kristján Valur Jónsson
> Cc: python-dev at python.org
> Subject: Re: [Python-Dev] recursive closures - reference leak
> What problem are you referring to?  Python has a gc exactly to deal
> with
> situations like this one.  Surely you are aware that the cycle
> collector
> is invoked automatically without requiring user intervention.  What
> specific issue are you trying to work around?

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 :)


More information about the Python-Dev mailing list