GC time debug...

David Jeske jeske at neotonic.com
Sat Jun 28 03:08:05 CEST 2003

On Thu, Jun 26, 2003 at 04:55:31PM -0400, Jeremy Hylton wrote:
> On Thu, 2003-06-26 at 02:47, David Jeske wrote:
> > In debugging Python GC actions, it's really useful to know the amount
> > of time Python spends doing the GC cycle (i.e. the pause time). I made
> > a quick hack to do this, and I've attached the patch. It needs to be
> > fixed to be portable. I wanted to just call floattime() from
> > timemodule.c, but it wasn't clear how to do this from gcmodule.c.
> Out of curiousity, what is this useful for?  Do you look for long pause
> times and try to change the code to reduce them?

In the past I've written high-performance websites in a
Python/C/Clearsilver combo model. The most notable of which is
egroups.com / Yahoo! Groups. Unpredictable pauses are bad, which is
one of the reasons I liked Python's ref-counting scheme. We just
didn't make cycles.

I'm starting up a new high-performance project, and I've been
evaluating Java. It has all kinds of GC pause problems, which are
exacerbated by the fact that all web processes live in a single mega
process and get stopped during GC. 

I wanted to know if it is acceptable to use Python's GC or not for
this application. Pause times under 0.2s are non-ideal but
acceptable. Longer than 0.2s isn't acceptable. If I have a cycle, I'd
rather leak the memory and let it clean up with the apache process
dies and reforks().

David Jeske  
Neotonic Software Corporation
email   jeske at neotonic.com
phone   (415) 701-8003x1
fax     (415) 704-3283

More information about the Python-list mailing list