[Python-Dev] Documentation about Python's GC, python-dev list messages referenced in Modules/gcmodule.c not reachable anymore

Neil Schemenauer nas at arctrix.com
Tue Dec 6 21:38:18 CET 2005


On Tue, Dec 06, 2005 at 11:20:46AM +0100, Weber, Gregoire wrote:
> We're seriously evaluating Python for use in embedded realtime systems
> and need some informations about Pythons garbage collector.
> 
> What we're interested mostly in the runtime behaviour of the GC. The
> main question is:
> 
>   Does it interrupt the python interpreter to collect stuff or 
>   is collecting done more in the background (e.g. just incrementally 
>   collecting)? This is an important question for realtime systems with
>   well defined reaction times.

It does not run in the background.  One option would be to disable
the cyclic garbage collector and rely on the reference counting
alone.  In that case, you will need to be sure that your code does
not create reference cycles.  Unfortunately I suspect there is now
Python library code that requires the cyclic collector to be
running.

> Just point me to documentation if available.

At this point the best documentation is the gcmodule.c code itself
(assuming the Python library documentation and my web page are not
sufficient).  The main entry point is collect().

If you really want to look at those old mailing list messages, you
can go the the index and search through the subject titles:

    http://www.python.org/pipermail/python-dev/2000-March/

Here are some starting points:

    http://mail.python.org/pipermail/python-dev/2000-March/002385.html
    http://mail.python.org/pipermail/python-dev/2000-March/002497.html

Note that most of discussion was related to handling finalizers
(e.g. __del__ methods) and is not relevant to your concerns.
 
  Neil


More information about the Python-Dev mailing list