[Patches] [ python-Patches-760990 ] add time elapsed to gc debug output

SourceForge.net noreply at sourceforge.net
Mon Dec 20 04:51:33 CET 2004


Patches item #760990, was opened at 2003-06-26 01:52
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=760990&group_id=5470

Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: David Jeske (jeske)
Assigned to: Nobody/Anonymous (nobody)
Summary: add time elapsed to gc debug output

Initial Comment:
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 change 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. It didn't seem like 
the right thing to do to copy the floattime() code from 
timemodule.c. I figured I would leave this simple detail to 
the experts.

My patch adds the gc time and the max gc time to 
the "done" line when debugging is enabled, making it look 
like this:

gc: collecting generation 0...
gc: objects in each generation: 702 5608 72421
gc: done. (0.000267006 s, max 0.151359 s)

I'd like to see this adopted in the gc module.

I also think it would be useful if there were a debugging 
mode to print out gc sweeps which take longer than a 
certain pause time, but I didn't make this change. 
However, it's possible to derive this from the logs.

(i.e. gc.debug_pauses(0.2) would print out a line for 
each gc pause over 0.2 seconds)


----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2004-12-19 22:51

Message:
Logged In: YES 
user_id=80475

Closing due to inaction.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2003-06-26 19:47

Message:
Logged In: YES 
user_id=31435

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file. In addition, even if you
*did* check this checkbox, a bug in SourceForge
prevents attaching a file when *creating* an issue.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=760990&group_id=5470


More information about the Patches mailing list