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

Jeff Hall hall.jeff at gmail.com
Wed Jun 25 21:56:11 CEST 2008

It seems to me that the root problem is allocation spikes of legitimate,
useful data. Perhaps then we need some sort of "test" to determine if those
are legitimate. Perhaps checking every nth (with n decreasing as allocation
bytes increases) object allocated during a "spike" could be useful. Then
delay garbage collection until x consecutive objects are found to be

It seems like we should be attacking the root cause rather than finding some
convoluted math that attempts to work for all scenarios.

On a side note, the information about not GCing on string objects is
interesting? Is there a way to override this behavior? I've found that re.py
chokes on large text files (4MB plus) without line ends (don't ask, they're
not our files but we have to parse them). I wonder if this isn't the

If the answer to that is, "no, strings are always ignored" I'd recommend
rethinking this (or providing an option to override somehow.

Haikus are easy
Most make very little sense
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20080625/52291f16/attachment.htm>

More information about the Python-Dev mailing list