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

"Martin v. Löwis" martin at v.loewis.de
Mon Jun 23 23:08:29 CEST 2008


> It would not help the quadratic behaviour - and is orthogonal to your proposal -
> , but at least avoid calling the GC too often when lots of small objects are 
> allocated (as opposed to lots of large objects).

I'd like to see in an experiment whether this is really true. Current GC
only takes into account container objects, which, most significantly,
ignores string objects (of which most applications create plenty). If
you make actual memory consumption a trigger, the string objects would
count towards triggering GC. That may or may not be the better approach,
anyway - but it's not certain (for me) that such a scheme would cause GC
to be triggered less often, in a typical application.

Regards,
Martin


More information about the Python-Dev mailing list