This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: adds a gc.get_generation function
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: nascheme Nosy List: gregory.p.smith, loewis, nascheme
Priority: normal Keywords: patch

Created on 2001-04-07 07:33 by gregory.p.smith, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gctool.diff gregory.p.smith, 2001-04-07 07:33 patch to gcmodule.c to add gc.get_generation() function useful for hunting memory leaks..
Messages (3)
msg36299 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2001-04-07 07:33
gc.get_generation(num) added by this patch allows you
to get a
list of all objects in a given garbage collector
generation.

I wrote this while trying to debug a memory leak so
that I could peek at what types of objects were
remaining allocated but never freed.

Looking through the patches I see another similarish
patch that allow for searching the collection lists for
references to a particular thing or set of things. 
interesting.

Is it useful?  Yes and no.  I still haven't found the
memory leak.  But I know what objects are consuming it
so I can narrow my search through to code to find how
they are remaining referenced.

as a side note, there's not much point in the
generation number parameter to this method, 2 is the
only generation really worth examining.

This or something like it would be nice to see in a
future python gc module as a debugging aid.
msg36300 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2001-06-06 06:45
Logged In: YES 
user_id=21627

I still would like to see my gc.getreferents patch 
applied, which offers a similar debugging aid.

However, since this offers a somewhat orthogonal 
functionality, and is a quite short patch, I recommend to 
approve it.
msg36301 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2001-08-09 16:05
Logged In: YES 
user_id=35752

Accepted in modified form as gc.get_objects.  Thanks Greg.
History
Date User Action Args
2022-04-10 16:03:56adminsetgithub: 34295
2001-04-07 07:33:46gregory.p.smithcreate