[Python-Dev] GC Changes

Neil Schemenauer nas at arctrix.com
Tue Oct 2 23:43:23 CEST 2007


Martin v. Löwis <martin at v.loewis.de> wrote:
>> Why isn't the mark-and-sweep mechanism used for all memory
>> management?
>
> See above - it's not implementable, because the root objects get not
> tracked.

To further elaborate, the main obstacle is with extension modules.
Most of them create roots and there is no defined API for the Python
interpreter to find them.

Perhaps a more serious problem is that CPython and 3rd party
extension modules rely heavily on the fact that the GC does not move
objects.  There are GC strategies that perform well when faced with
high object allocation rates but, AFAIK, all of them rely on moving
objects.

  Neil



More information about the Python-Dev mailing list