Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow gc.getobjects to return the objects tracked by a specific generation #80197

Closed
pablogsal opened this issue Feb 17, 2019 · 2 comments
Closed
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@pablogsal
Copy link
Member

BPO 36016
Nosy @nascheme, @pitrou, @methane, @pablogsal
PRs
  • bpo-36016: Allow gc.getobjects to return the objects in a specific generation #11909
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-02-23.11:50:17.660>
    created_at = <Date 2019-02-17.20:20:35.053>
    labels = ['interpreter-core', '3.8']
    title = 'Allow gc.getobjects to return the objects tracked by a specific generation'
    updated_at = <Date 2019-02-23.11:50:17.660>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2019-02-23.11:50:17.660>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-02-23.11:50:17.660>
    closer = 'methane'
    components = ['Interpreter Core']
    creation = <Date 2019-02-17.20:20:35.053>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36016
    keywords = ['patch']
    message_count = 2.0
    messages = ['335787', '336357']
    nosy_count = 4.0
    nosy_names = ['nascheme', 'pitrou', 'methane', 'pablogsal']
    pr_nums = ['11909']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36016'
    versions = ['Python 3.8']

    @pablogsal
    Copy link
    Member Author

    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.

    @pablogsal pablogsal added 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Feb 17, 2019
    @methane
    Copy link
    Member

    methane commented Feb 23, 2019

    New changeset 175421b by Inada Naoki (Pablo Galindo) in branch 'master':
    bpo-36016: Add generation option to gc.getobjects() (GH-11909)
    175421b

    @methane methane closed this as completed Feb 23, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants