-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-40630: add tracemalloc.reset_peak #20102
bpo-40630: add tracemalloc.reset_peak #20102
Conversation
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).
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Thanks for the speedy review @vstinner 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a new "tracemalloc" sub-section in Doc/whatsnew/3.10.rst, in the "Improved Modules" section, and describe your change? You can copy/paste the NEWS entry and add (Contributed by ...): see Doc/whatsnew/3.9.rst for examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I would prefer to update directly What's New in Python 3.10.
I've added it. It looks like this just missed 3.9 beta cut off? Does that mean it likely has to wait a year or more to be released? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, apart the missing "versionadded" markup.
@ambv: @huonw would like to get it in Python 3.9, but we missed the feature freeze by 2 days. IMO such feature can wait for Python 3.10. On the other side, there is (very) low risk of regression. It's up to you, Łukasz. I'm waiting for @ambv feedback before merging, since currently it's documented at new feature in Python 3.10.
meaningfully compared to snapshots taken after the call. | ||
|
||
See also :func:`get_traced_memory`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you need to add ".. versionadded:: 3.10".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
It's fine to land for 3.10; I was just a little disconcerted and unhappy that we missed the feature cut-off by days, and so will probably have to wait for an extra year for this to be released. |
Thanks, I merged your PR into master. The good news if that Python 3.10 will be the first release with a short dev cycle of only 1 year except of 18 months. |
I would be fine for this to land in 3.9b2.
… On 22 May 2020, at 16:20, Victor Stinner ***@***.***> wrote:
Thanks, I merged your PR into master.
The good news if that Python 3.10 will be the first release with a short dev cycle of only 1 year except of 18 months.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
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).
…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).
* bpo-40630: Add tracemalloc.reset_peak (GH-20102, cherrypick 8b62644) 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). * Adjust docs to point to 3.9
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()
ortracemalloc.clear_traces()` call).
https://bugs.python.org/issue40630