[2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var#3927
Merged
vstinner merged 3 commits intopython:2.7from Oct 17, 2017
vstinner:count_allocs_envvar27
Merged
[2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var#3927vstinner merged 3 commits intopython:2.7from vstinner:count_allocs_envvar27
vstinner merged 3 commits intopython:2.7from
vstinner:count_allocs_envvar27
Conversation
bpo-31692, bpo-19527: * Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to the Python 3 "-X showalloccount" option * When Python is compiled with COUNT_ALLOCS, the new PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump allocation counts into stderr on shutdown. Moreover, allocations statistics are now dumped into stderr rather than stdout. * Add @test.support.requires_type_collecting decorator: skip test if COUNT_ALLOCS is defined * Fix tests for COUNT_ALLOCS: decorate some methods with @requires_type_collecting * test_sys.test_objecttypes(): update object type when COUNT_ALLOCS is defined
Member
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Using the requires_type_collecting decorator LGTM. But I don't sure about adding PYTHONSHOWALLOCCOUNT. This looks like a new feature to me.
What if split this PR on two parts? The one fixes issues related to immortal types, the other is about additional output.
|
|
||
| .. envvar:: PYTHONSHOWALLOCCOUNT | ||
|
|
||
| If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will |
Member
There was a problem hiding this comment.
It may be worth to document the changes in Doc/c-api/typeobj.rst too.
Member
Author
There was a problem hiding this comment.
I prefer to keep the description of all environment variables at the same place. I added a reference to the env var in Doc/c-api/typeobj.rst.
Member
Author
|
Serhiy: "... This looks like a new feature to me ..." I prefer to discuss on the bpo: https://bugs.python.org/issue31692#msg303959 |
serhiy-storchaka
approved these changes
Oct 9, 2017
benjaminp
approved these changes
Oct 17, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bpo-31692, bpo-19527:
the Python 3 "-X showalloccount" option
PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump
allocation counts into stderr on shutdown. Moreover, allocations
statistics are now dumped into stderr rather than stdout.
COUNT_ALLOCS is defined
@requires_type_collecting
is defined
https://bugs.python.org/issue31692