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.

Title: Allow gc.getobjects to return the objects tracked by a specific generation
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.8
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: methane, nascheme, pablogsal, pitrou
Priority: normal Keywords: patch

Created on 2019-02-17 20:20 by pablogsal, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11909 merged pablogsal, 2019-02-17 20:21
Messages (2)
msg335787 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-02-17 20:20
gc.get_objects() return all the objects tracked by the garbage collector. This is useful, but right now there is no way of knowing in which generation each object is currently on. This information can be beneficial to understand better the state of the garbage collector in a particular moment in time. 

This will allow knowing what are the oldest object tracked by the collector, gathering more fine-grained statistics about how generations are filled, better debugging and better insights about the internal structure of the generations.

To allow this, I propose a new optional parameter to gc.get_objects, allowing the user to specify the generation to get the objects from.
msg336357 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2019-02-23 03:02
New changeset 175421b58cc97a2555e474f479f30a6c5d2250b0 by Inada Naoki (Pablo Galindo) in branch 'master':
bpo-36016: Add generation option to gc.getobjects() (GH-11909)
Date User Action Args
2022-04-11 14:59:11adminsetgithub: 80197
2019-02-23 11:50:17methanesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-02-23 03:02:10methanesetnosy: + methane
messages: + msg336357
2019-02-17 20:35:15pablogsalsetnosy: + pitrou
2019-02-17 20:22:27pablogsalsetnosy: + nascheme
2019-02-17 20:21:59pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request11935
2019-02-17 20:20:35pablogsalcreate