Skip to content

[3.9] bpo-40630: Add tracemalloc.reset_peak (GH-20102)#20545

Merged
vstinner merged 2 commits intopython:3.9from
huonw:issue40630-tracemalloc-reset-peak-3.9
Jun 1, 2020
Merged

[3.9] bpo-40630: Add tracemalloc.reset_peak (GH-20102)#20545
vstinner merged 2 commits intopython:3.9from
huonw:issue40630-tracemalloc-reset-peak-3.9

Conversation

@huonw
Copy link
Copy Markdown
Contributor

@huonw huonw commented May 31, 2020

This is a backporting cherrypick of GH-20102 (8b62644 specifically) per #20102 (comment).

The reset_peak function sets the peak memory size to the current size,
representing a resetting of that metric. This allows for recording the
peak of specific sections of code, ignoring other code that may have
had a higher peak (since the most recent tracemalloc.start() or
tracemalloc.clear_traces() call).

https://bugs.python.org/issue40630

huonw added 2 commits May 31, 2020 09:43
…2644)

The reset_peak function sets the peak memory size to the current size,
representing a resetting of that metric. This allows for recording the
peak of specific sections of code, ignoring other code that may have
had a higher peak (since the most recent `tracemalloc.start()` or
tracemalloc.clear_traces()` call).
@huonw
Copy link
Copy Markdown
Contributor Author

huonw commented May 31, 2020

Hi @vstinner, this PR backports #20102 to the 3.9 branch (and #20546 (hopefully) updates the master documentation correctly). I'd appreciate if you could help me with the right process here. 😄

@vstinner
Copy link
Copy Markdown
Member

vstinner commented Jun 1, 2020

Thanks, merged.

@huonw huonw deleted the issue40630-tracemalloc-reset-peak-3.9 branch June 1, 2020 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants