classification
Title: tracemalloc: allow resetting peak memory metric without touching other traces
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: huonw, vstinner
Priority: normal Keywords: patch

Created on 2020-05-15 02:12 by huonw, last changed 2020-06-01 17:27 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20102 merged huonw, 2020-05-15 03:42
PR 20545 merged huonw, 2020-05-31 00:29
PR 20546 merged huonw, 2020-05-31 00:30
Messages (6)
msg368916 - (view) Author: Huon Wilson (huonw) * Date: 2020-05-15 02:12
Per https://mail.python.org/archives/list/python-ideas@python.org/thread/QDWI37A4TJXOYUKULGPY2GKD7IG2JNDC/ , it would be helpful to have a function that resets the peak memory usage of the tracemalloc module, without changing all the traces.

This allows for recording the peak memory usage of a specific region of code, rather than only the peak since the last tracemalloc.start() or tracemalloc.clear_traces() call.
msg369604 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-22 14:18
New changeset 8b62644831443e400215eeb822c921f4f06c8977 by Huon Wilson in branch 'master':
bpo-40630: Add tracemalloc.reset_peak (GH-20102)
https://github.com/python/cpython/commit/8b62644831443e400215eeb822c921f4f06c8977
msg369605 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-22 14:20
Thanks Huon Wilson!
msg370566 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-06-01 17:26
New changeset 3c7609a23cf6e011f2cd411e28d9dcb1b087929c by Huon Wilson in branch '3.9':
[3.9] bpo-40630: Add tracemalloc.reset_peak (GH-20102) (GH-20545)
https://github.com/python/cpython/commit/3c7609a23cf6e011f2cd411e28d9dcb1b087929c
msg370567 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-06-01 17:26
New changeset 39de8e4b6f139f8d8284732bd7bb6e5ccced29fa by Huon Wilson in branch 'master':
bpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546)
https://github.com/python/cpython/commit/39de8e4b6f139f8d8284732bd7bb6e5ccced29fa
msg370568 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-06-01 17:27
Feature added to Python 3.9. Lukasz allowed to add the feature to Python 3.9 beta2:
https://github.com/python/cpython/pull/20102#issuecomment-632728791
History
Date User Action Args
2020-06-01 17:27:29vstinnersetmessages: + msg370568
versions: + Python 3.9, - Python 3.10
2020-06-01 17:26:37vstinnersetmessages: + msg370567
2020-06-01 17:26:29vstinnersetmessages: + msg370566
2020-05-31 00:30:44huonwsetpull_requests: + pull_request19791
2020-05-31 00:29:15huonwsetpull_requests: + pull_request19790
2020-05-22 14:20:06vstinnersetstatus: open -> closed
versions: + Python 3.10, - Python 3.9
messages: + msg369605

resolution: fixed
stage: patch review -> resolved
2020-05-22 14:18:55vstinnersetmessages: + msg369604
2020-05-15 03:42:10huonwsetkeywords: + patch
stage: patch review
pull_requests: + pull_request19409
2020-05-15 02:12:35huonwcreate