Interest in generational GC for Python

Discussion in 'Python' started by Borked Pseudo Mailed, Apr 19, 2009.

  1. Hello,

    Is there any interest in generational garbage collection in Python these days ?

    Anyone working on it ?

    Thanks
    Borked Pseudo Mailed, Apr 19, 2009
    #1
    1. Advertising

  2. Borked Pseudo Mailed <nobody <at> pseudo.borked.net>
    writes:

    >
    > Hello,
    >
    > Is there any interest in generational garbage
    > collection
    > in Python these days ?
    >
    > Anyone working on it ?


    The PyPy project has implemented more GC's than you want to
    think about
    including a ref counting gc, mark-sweep, and
    several generational GCs and have
    received excellent performance from them.
    You should look at their new beta release.
    Benjamin Peterson, Apr 20, 2009
    #2
    1. Advertising

  3. > Is there any interest in generational garbage collection in Python these days ?
    >
    > Anyone working on it ?


    This is the time machine at work: the garbage collector in CPython *is*
    generational (with three generations).

    Regards,
    Martin
    Martin v. Löwis, Apr 20, 2009
    #3
  4. > I'm lost there. Isn't CPython using reference counting (i.e updating the
    > object's state at each reference creation/deletion, and deleting the
    > objects as soon as they have no more references to them) ? It seemed to
    > me that generational GC only applied to periodic GCs, like tracing
    > garbage collectors. Or is CPython using a mix of both technologies (to
    > prevent cycles for example) ?


    The latter, since Python 2.2. See Modules/gcmodule.c for implementation
    details.

    It can't really prevent cycles, but it can collect them once they become
    garbage (and the garbage collector is triggered, in the right
    generation). Objects not participating in cycles are released
    immediately when they become unreachable.

    Regards,
    Martin
    Martin v. Löwis, Apr 20, 2009
    #4
    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. ulysses
    Replies:
    4
    Views:
    764
    Werner Schiendl
    Oct 22, 2003
  2. Brian Lloyd
    Replies:
    0
    Views:
    274
    Brian Lloyd
    Dec 4, 2003
  3. Kenneth McDonald
    Replies:
    3
    Views:
    273
    Steven Bethard
    Oct 25, 2006
  4. Arvind
    Replies:
    14
    Views:
    546
    Frank Chang
    Aug 26, 2005
  5. Carl Banks

    Generational Interfaces

    Carl Banks, Jan 26, 2008, in forum: Python
    Replies:
    5
    Views:
    272
Loading...

Share This Page