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

Expose tracemalloc C API to track/untrack memory blocks #74240

Closed
vstinner opened this issue Apr 12, 2017 · 7 comments
Closed

Expose tracemalloc C API to track/untrack memory blocks #74240

vstinner opened this issue Apr 12, 2017 · 7 comments
Labels
3.7 (EOL) end of life type-feature A feature request or enhancement

Comments

@vstinner
Copy link
Member

BPO 30054
Nosy @vstinner
PRs
  • bpo-30054: Expose tracemalloc C API #1236
  • 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 2017-06-20.15:47:31.122>
    created_at = <Date 2017-04-12.13:42:25.341>
    labels = ['type-feature', '3.7']
    title = 'Expose tracemalloc C API to track/untrack memory blocks'
    updated_at = <Date 2017-06-20.15:47:31.121>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-06-20.15:47:31.121>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-06-20.15:47:31.122>
    closer = 'vstinner'
    components = []
    creation = <Date 2017-04-12.13:42:25.341>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30054
    keywords = []
    message_count = 7.0
    messages = ['291554', '291556', '291557', '291558', '292029', '296463', '296464']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'jtaylor']
    pr_nums = ['1236']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30054'
    versions = ['Python 3.7']

    @vstinner
    Copy link
    Member Author

    The issue bpo-26530 added a private C API to manually track/untrack memory blocks in tracemalloc. I was just validated by Julian Taylor who confirms that the API works as expected:
    http://bugs.python.org/issue26530#msg291551

    So I propose to make the 3 newly added functions public and document them:

    • _PyTraceMalloc_Track()
    • _PyTraceMalloc_Untrack()
    • _PyTraceMalloc_GetTraceback()

    @vstinner vstinner added 3.7 (EOL) end of life type-feature A feature request or enhancement labels Apr 12, 2017
    @jtaylor
    Copy link
    Mannequin

    jtaylor mannequin commented Apr 12, 2017

    I am not sure if _PyTraceMalloc_GetTraceback really needs to be a public function.
    Exposing the tracing information should probably just go over python interfaces.

    @vstinner
    Copy link
    Member Author

    What's the status in numpy? Is the current numpy release able to use CPython 3.6 tracemalloc private functions?

    @jtaylor
    Copy link
    Mannequin

    jtaylor mannequin commented Apr 12, 2017

    With this changeset it would:
    numpy/numpy#8885

    @vstinner
    Copy link
    Member Author

    @jtaylor: Ok, I created #1236

    @vstinner
    Copy link
    Member Author

    New changeset 5ea4c06 by Victor Stinner in branch 'master':
    bpo-30054: Expose tracemalloc C API (bpo-1236)
    5ea4c06

    @vstinner
    Copy link
    Member Author

    I merged my PR: the future Python 3.7 will provide a public C API to track memory allocations.

    @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.7 (EOL) end of life type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant