To GC or not to GC?

Kenny Tilton ktilton at nyc.rr.com
Thu Nov 21 15:49:55 EST 2002


OK, newbie here, recently reassured that Python now comes with 
generational GC that can handle cyclic refs of otherwise unreachable stuff.

But the doc: http://www.python.org/doc/2.2p1/ref/objects.html

...says "(Implementation note: the current implementation uses a 
reference-counting scheme with (optional) delayed detection of cyclicly 
linked garbage, which collects most objects as soon as they become 
unreachable, but is not guaranteed to collect garbage containing 
circular references. See the Python Library Reference for information on 
controlling the collection of cyclic garbage.)"

following that link I see: "This [GC] module provides an interface to 
the optional garbage collector. ... It also provides access to 
unreachable objects that the collector found but cannot free. 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."

My questions are:

1. Is that doc up to date? I see Mar 2002, not too shabby.

2. Well, I should almost wait before asking further, but if you'll 
forgive a little lookahead, that "supplements reference counting" scares 
me. Is ref counting history or not? mind you, i understand there is a 
lot of code out there taht must be supported, but for new code...?

TIA...

-- 

  kenny tilton
  clinisys, inc
  ---------------------------------------------------------------
""Well, I've wrestled with reality for thirty-five years, Doctor,
   and I'm happy to state I finally won out over it.""
                                                   Elwood P. Dowd




More information about the Python-list mailing list