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: Expose tracemalloc C API to track/untrack memory blocks
Type: enhancement Stage: resolved
Components: Versions: Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jtaylor, vstinner
Priority: normal Keywords:

Created on 2017-04-12 13:42 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1236 merged vstinner, 2017-04-21 12:08
Messages (7)
msg291554 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-12 13:42
The issue #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:

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

* _PyTraceMalloc_Track()
* _PyTraceMalloc_Untrack()
* _PyTraceMalloc_GetTraceback()
msg291556 - (view) Author: Julian Taylor (jtaylor) Date: 2017-04-12 13:48
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.
msg291557 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-12 14:11
What's the status in numpy? Is the current numpy release able to use CPython 3.6 tracemalloc private functions?
msg291558 - (view) Author: Julian Taylor (jtaylor) Date: 2017-04-12 14:14
With this changeset it would:
msg292029 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-21 12:09
@jtaylor: Ok, I created
msg296463 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-20 15:46
New changeset 5ea4c0677389ead2eee759958694cff2c65834a7 by Victor Stinner in branch 'master':
bpo-30054: Expose tracemalloc C API (#1236)
msg296464 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-20 15:47
I merged my PR: the future Python 3.7 will provide a public C API to track memory allocations.
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74240
2017-06-20 15:47:31vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg296464

stage: resolved
2017-06-20 15:46:39vstinnersetmessages: + msg296463
2017-04-21 12:09:03vstinnersetmessages: + msg292029
2017-04-21 12:08:44vstinnersetpull_requests: + pull_request1354
2017-04-12 14:14:29jtaylorsetmessages: + msg291558
2017-04-12 14:11:10vstinnersetmessages: + msg291557
2017-04-12 13:48:46jtaylorsetmessages: + msg291556
2017-04-12 13:42:25vstinnercreate