GC time debug...

Discussion in 'Python' started by David Jeske, Jun 26, 2003.

  1. David Jeske

    David Jeske Guest

    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.

    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 something like this added to 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.

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

    --
    David Jeske
    Neotonic Software Corporation
    email
    phone (415) 701-8003x1
    fax (415) 704-3283
    David Jeske, Jun 26, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RonL
    Replies:
    0
    Views:
    739
  2. ringos75
    Replies:
    0
    Views:
    958
    ringos75
    Apr 14, 2005
  3. Mike C. Fletcher
    Replies:
    3
    Views:
    981
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 12, 2003
  4. André
    Replies:
    3
    Views:
    1,588
  5. flamesrock
    Replies:
    8
    Views:
    454
    Hendrik van Rooyen
    Nov 24, 2006
Loading...

Share This Page