[Python-Dev] C API for gc.enable() and gc.disable()

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 20 02:36:59 CEST 2008


Alexandre Vassalotti wrote:

> Do you have any idea how this behavior could be fixed? I am not a GC
> expert, but I could try to fix this.

Perhaps after making a GC pass you could look at the
number of objects reclaimed during that pass, and if
it's less than some fraction of the objects in existence,
increase the threshold for performing GC by some
factor.

You would also want to do the opposite, so that a
GC pass which reclaims a large proportion of objects
would reduce the threshold back down again.

-- 
Greg


More information about the Python-Dev mailing list