Roel Schroeven wrote:
> Charlie Strauss schreef:
>>>On Oct 1, 2006, at 9:48 AM, Fredrik Lundh wrote:
>>>>>charlie strauss wrote:
>>>>>>>Could you clarify that for me. GC really has three components
>>>>two it: 1) finding and freeing unrefernced memory by refer
>>>>refer counts 2) cycle removal and 3) defragementing the
>>>>storage stack. If I turn off GC, don't I lose all of these?
>>>>>>>>>>CPython always does (1), only does (2) if cycle-breaking GC isn't
>>>disabled, and never does (3).
>>> [snip]
>>>And just to be clear: are you saying that when I do a gc.disable this
>>only turns off 2 and not 1? The docs don't say that as far as I can
>>tell.
>>> AFAIK Python always does reference counting, and the garbage collector
> is used only for more difficult cases. As the gc module docs say:
> "Since the collector supplements the reference counting already used in
> Python, you can disable the collector if you are sure your program does
> not create reference cycles."
>> I don't know if that's only true for CPython or also for the other
> implementations.
>Read the documentation: the garbage collector is called regularly in
CPython.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden