Garbage Collection Explanation

Neil Schemenauer nas at python.ca
Sun Dec 1 17:19:52 EST 2002


Markus Schaber wrote:
> I remember to have read an article on the web that explained the Python
> 2.X Garbage collector in detail, especially the Idea with the
> generations.

I wrote about it a little while I was implementing it.  See
http://python.ca/nas/python/gc/ .  I think the algorithm is similar to
the one described in:

    author="T.W. Christopher",
    title="Reference Count Garbage Collection",
    journal=SPE,
    publisher=Wiley,
    address=Wileyaddress,
    volume=14,
    number=6,
    pages="503--507",
    month="June",
    year="1984",
    comments={ \com
    A heap management scheme fo languages (such as Fortran) which do not
    have this facility buit in.  Does not rely on the existance of {\it
    roots} in the graph.  His complex algorithm actually contains a cyclic
    reference count algorithm.
    ,
    }

The code in gcmodule.c is pretty readable, IMHO.  You might want to go
straight to the source.

  Neil




More information about the Python-list mailing list